Skip to content

fix(session): the inbox poll waits for its own read - #92

Closed
Tarquinen wants to merge 1 commit into
port-pollingfrom
port-inbox
Closed

Tarquinen wants to merge 1 commit into
port-pollingfrom
port-inbox

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

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 theInboxPollNeverCancelsItsOwnSlowRead fails without the fix (each read cancelled by the next); removed the poll's PendingInputsRequested receives from the existing tests, as iOS did; scripts/check.sh :feature:session passes.

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.
@Tarquinen

Copy link
Copy Markdown
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.

@Tarquinen Tarquinen closed this Nov 15, 2026
@Tarquinen
Tarquinen deleted the port-inbox branch November 15, 2026 07:38

This branch was previously deployed

1 inactive deployment
release — 0f5a8d50 Deployed Nov 15, 2026 by Tarquinen via check #268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant