Repository navigation
Conversation
Port of the inbox part of iOS 0d329484. The inbox poll sent PendingInputsRequested on each tick, and that read cancels the one before it. On an unhealthy stream the tick is every 2 s, so on a slow connection no read ever finished and the queued messages never updated. The loop now awaits its own read before sleeping; live inbox events keep their own superseding read. Verified: new theInboxPollNeverCancelsItsOwnSlowRead fails without the fix (4 reads started, each cancelling the last); a throwaway test on origin/dev saw 5 reads of a 3 s read in 9 s and none answered. Removed the PendingInputsRequested receives the poll no longer sends, as iOS did. vm.sh check :feature:session passes.
Member
Author
|
Closing: this can't happen on Android today. Polls stop while the stream is down, and with a healthy stream the 12 s tick is longer than the read's 10 s timeout, so a read can't be overtaken. |
This branch was previously deployed
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.
Based on #91.
The inbox poll asked for a new read on each tick, and each new read cancels the one before it. With the event stream unhealthy the tick is every 2 s, so on a slow connection no read ever finished and queued messages never updated. The poll now waits for its own read before sleeping; live inbox events still replace a read in flight.
iOS: 0d329484 (the inbox part)
Emulator: couldn't reproduce on Android. While the stream is down, Home marks requests unavailable and the polls stop, so the 2 s tick never ran with a slow inbox (stream dropped and held 8 s, inbox delayed 3 s: no inbox reads on either build). On a healthy stream the 12 s tick is longer than the read's 10 s timeout, so a read can't be overtaken there either. This keeps the poll from cancelling itself if that state is ever reached.
Verified: new
theInboxPollNeverCancelsItsOwnSlowReadfails without the fix (each read cancelled by the next); removed the poll'sPendingInputsRequestedreceives from the existing tests, as iOS did;scripts/check.sh :feature:sessionpasses.