Repository navigation
Conversation
Typos such as thread_id (instead of thread_ts) or unfurl_link (instead of unfurl_links) were forwarded silently into the request body, so a threaded reply could post as a top-level channel message with no error or warning. Add _warn_if_unknown_kwargs and call it from chat_postMessage before merging declared parameters. **kwargs remains an escape hatch for undocumented API fields; unknown keys now emit a UserWarning. Fixes slackapi#1923.
|
Thanks for the contribution! Before we can merge this, we need @Eryx-Z to sign the Salesforce Inc. Contributor License Agreement. |
Author
|
Closing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chat_postMessage(and other Web API methods) accept**kwargsas an escape hatch for undocumented API parameters. Typos such asthread_idinstead ofthread_tsorunfurl_linkinstead ofunfurl_linkswere forwarded into the request body with no warning, so a threaded reply could silently post as a top-level channel message.This adds
_warn_if_unknown_kwargsand calls it fromchat_postMessagebefore merging declared parameters.**kwargsremains an escape hatch; unknown keys now emit aUserWarning.Fixes #1923.
Test plan
thread_id/unfurl_linktypos and for knownthread_tsasync_client.py/legacy_client.pyviascripts/codegen.pyscripts/format.sh