Skip to content

0.9.11: back from a sleep, the chat is read at once - #48

Merged
Ege-BULUT merged 1 commit into
mainfrom
resume-reads
Nov 6, 2026
Merged

Ege-BULUT merged 1 commit into
mainfrom
resume-reads

Conversation

@Ege-BULUT

Copy link
Copy Markdown
Owner

A user reported that phone notifications arrived but the messages showed up late, especially after the screen had been off or locked.

Cause. A read started before the phone slept could hang on a connection that died in the meantime. The poll loop waited on that read (sometimes for minutes) instead of looking again. wake() only ends the loop's sleep, so it can't free a tick that is stuck in a request.

Fix.

  • The app's buses go through readFetch, which covers GET requests and GraphQL queries:
    • they are given up when the app comes back after more than 5 s away (visibilitychange, plus appStateChange on Android);
    • none of them waits more than 30 s for GitHub to start answering.
  • Writes (a message being sent) go through unchanged.
  • Coming back also polls 3 times, a second apart, because GitHub can briefly still show the branch as it was.
  • The start sends the /repos check and the watcher's head read together. The /repos error is still the one shown.

Tests.

  • New resume section in test/app.e2e.mjs: one head read hangs for 25 s, then the page goes hidden for 5.5 s and comes back. The message shows in 1.3 s. With the fix turned off it takes 19.5 s and the test fails.
  • Unit 93/93, CLI 47/47, MCP 18/18, browser 112/112.

…at is read at once

A read started before the phone locked could hang on a dead connection, and the
poll waited on it (minutes) instead of looking again. The app's buses now go
through readFetch: GET and GraphQL queries are given up when the app comes back
after more than 5 s away (visibilitychange, and appStateChange on Android), and
none waits more than 30 s for GitHub to start answering. Writes are left alone.
Coming back also polls a few times a second apart, and the start asks for the
repository and the head together.
@Ege-BULUT
Ege-BULUT merged commit 4d0907a into main Nov 6, 2026
1 check passed
@Ege-BULUT
Ege-BULUT deleted the resume-reads branch November 6, 2026 05:18
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