Repository navigation
zulip: Exclude message_id from request body in update_message and reactions - #931
Open
knowprasad wants to merge 1 commit into
Open
knowprasad wants to merge 1 commit into
knowprasad wants to merge 1 commit into
Conversation
…ctions. In update_message, add_reaction, and remove_reaction, message_id is embedded directly in the endpoint URL path. Forwarding message_id in the request payload dictionary causes the Zulip server to return an ignored_parameters_unsupported warning. Strip message_id from the forwarded payload dictionary without mutating the caller's input dictionary. Fixes: zulip#789. Signed-off-by: prsdx <prsdx.dev@gmail.com>
knowprasad
force-pushed
the
fix-789-strip-message-id-endpoint-requests
branch
from
October 25, 2026 05:06
918281b to
f75af60
Compare
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.
Fixes: #789
Summary
In
update_message,add_reaction, andremove_reaction,message_idis supplied in the URL path (/messages/{message_id}and/messages/{message_id}/reactions). Because the input dictionary was previously passed directly as therequestparameter tocall_endpoint,message_idwas also forwarded in the request payload, triggering anignored_parameters_unsupported: ["message_id"]warning response from the Zulip server.This PR:
message_idfrom the forwarded request payload via{k: v for k, v in data.items() if k != "message_id"}inupdate_message,add_reaction, andremove_reaction.zulip/tests/test_message_endpoints.pyasserting thatmessage_idis present in the endpoint URL but excluded from the body payload, and that the original dictionary is unmutated.How did you test this PR?
Ran pytest locally across the test suite:
pytest zulip/tests/test_message_endpoints.pyAll 6 tests passed cleanly.
Self-review checklist
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: