Skip to content

Tweaking warnings related to missing accessibility fields text and fallback when posting messages - #983

Merged
seratch merged 2 commits into
mainfrom
fallback-args-warn
May 6, 2022
Merged

seratch merged 2 commits into
mainfrom
fallback-args-warn

Conversation

@filmaj

@filmaj filmaj commented May 6, 2022

Copy link
Copy Markdown
Contributor

Making similar changes here as to slackapi/node-slack-sdk#1479.

Not sure about the tests... I didn't change the logic for any tests. Wasn't sure how to go about testing the warnings raised. If anyone has suggestions for me on how to add tests for this, please let me know!

@filmaj filmaj added enhancement M-T: A feature request for new functionality project:slack-api-client project:slack-api-client labels May 6, 2022
@filmaj filmaj added this to the 1.22.1 milestone May 6, 2022
@filmaj
filmaj requested a review from seratch May 6, 2022 18:10
@filmaj filmaj self-assigned this May 6, 2022
@codecov

codecov Bot commented May 6, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #983 (143f84d) into main (cdee9e5) will decrease coverage by 0.00%.
The diff coverage is 75.00%.

@@             Coverage Diff              @@
##               main     #983      +/-   ##
============================================
- Coverage     76.87%   76.86%   -0.01%     
  Complexity     3677     3677              
============================================
  Files           400      400              
  Lines         11089    11089              
  Branches       1105     1105              
============================================
- Hits           8525     8524       -1     
  Misses         1895     1895              
- Partials        669      670       +1     
Impacted Files Coverage Δ
...java/com/slack/api/methods/RequestFormBuilder.java 88.25% <75.00%> (ø)
...imits/metrics/impl/BaseMemoryMetricsDatastore.java 84.84% <0.00%> (-0.44%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdee9e5...143f84d. Read the comment docs.

Comment on lines +885 to +886
// 2021-01-05 14:38:54,767 WARN [main] com.slack.api.methods.RequestFormBuilder The top-level `text` argument is missing in the request payload for a chat.postMessage call - It's a best practice to always provide a `text` argument when posting a message. The `text` is used in places where `blocks` cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.
// 2021-01-05 14:38:55,055 WARN [main] com.slack.api.methods.RequestFormBuilder Additionally, the attachment-level `fallback` argument is missing in the request payload for a chat.postMessage call - To avoid this warning, it is recommended to always provide a top-level `text` argument when posting a message. Alternatively, you can provide an attachment-level `fallback` argument, though this is now considered a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filmaj Testing the logging output with the current code is not so easy that I added the evidence here (better than nothing!). Can you replace the logging output with your own one? You can find your logs at slack-api-client/logs/console.log.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seratch Done!

@seratch

seratch commented May 6, 2022

Copy link
Copy Markdown
Contributor

@filmaj Thanks for working on this!

@seratch
seratch merged commit e1f7d2d into main May 6, 2022
@seratch
seratch deleted the fallback-args-warn branch May 6, 2022 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality project:slack-api-client project:slack-api-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants