api: Use batch-based narrow updates for marking messages as read (#820)#909
Open
abdallah-9a wants to merge 1 commit intozulip:mainfrom
Open
api: Use batch-based narrow updates for marking messages as read (#820)#909abdallah-9a wants to merge 1 commit intozulip:mainfrom
abdallah-9a wants to merge 1 commit intozulip:mainfrom
Conversation
9d9ef85 to
c191d96
Compare
Author
|
I've implemented the batching logic to resolve the timeout issue (#820). However, I'm encountering a conflict in the CI's OpenAPI schema validation: Some tests expect the legacy response (only result and msg). Other tests (likely for newer server versions) fail because 'complete' is a required property. I've tried to provide a compatible response, but the validator still flags 'additional properties' in some environments. I'd appreciate guidance on how to satisfy both schemas in the SDK while maintaining the batching logic. My implementation correctly handles the feature_level >= 155 check. |
Author
|
Here is the error from the CI that required the 'complete' property: |
23a71a1 to
8e54378
Compare
8e54378 to
ecff1ed
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.
Summary
This PR addresses the server-side timeout issue when marking a large number of messages as read (Issue #820).
Changes
update_message_flags_for_narrowto support the modern batch-based endpoint (Feature Level 155+).mark_all_as_read,mark_stream_as_read, andmark_topic_as_readto use a batching logic withlast_processed_idas the anchor.DeprecationWarningto legacy methods to encourage switching to the more reliable narrow-based API.Testing
found_newestflag correctly terminates the loop.Fixes #820