Skip to content

fix(web): reconcile foreground messages independently of websocket validation - #861

Merged
GenerQAQ merged 2 commits into
mainfrom
fix/foreground-message-reconciliation
Oct 1, 2026
Merged

GenerQAQ merged 2 commits into
mainfrom
fix/foreground-message-reconciliation

Conversation

@GenerQAQ

@GenerQAQ GenerQAQ commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Why we need this PR?

Focused message reconciliation is coupled to WebSocket reconnect recovery. A healthy retained socket can skip it, while an unresponsive socket delays it behind ten-second validation even when HTTP is available.

What changed

  • Notify focused message recovery from existing foreground signals independently of pending WS probe/token/auth work.
  • Reuse primary/secondary/DM reconciliation and share in-flight work across foreground, reconnect and gap repair, retaining account/access/query publication fences.
  • Consume gaps arriving during pagination replay; replay only actual pending pagination and retain bounded catch-up.
  • Cover empty-window first gaps, the eight-read limit, revoked/replaced query replies and a real same-query cold reset. No timeout, native bridge, dependency or telemetry changes.

Validation at head 86f1d345d95db52cb7949730aeb3bd67c83b20a1:

  • Normal commit hooks pass. Independent seven-file suite: 223 tests pass. Author Web freshly ran 895 files/8816 tests; eight other Turbo packages cached. Six existing lint warnings, no errors.
  • Test-only follow-up exercises all four previously uncovered paths. Final exact-head Codecov patch passes at122/122 (100%, zero misses/partials), with one complete expected Ubuntu upload and PR/commit totals matching; all final-head Hosted checks pass, including static checks, Ubuntu coverage, twelve UI shards, UI E2E Gate and CI Gate. Initial Web E2E had377/379 passing: agent-link-upsert first PUT returned500 instead of201, then second PUT201 instead of200. One existing Hosted failed-jobs reproduction on the identical checkout passed48 files/379 tests, including all five upsert cases. First-run logs/failures remain retained; the500 root cause is UNKNOWN and this finite success is reported as non-reproduction, not a diagnosed infrastructure/flaky cause. The execution plan selects Web integration only. Previous head had all normal CI and twelve UI shards passing, but patch coverage failed at118/122 (96.72%); that previous result is not new-head acceptance.
  • Android QA HOME-to-return on e001b8e92 retained the healthy connection and fetched messages. With the owned WS service paused, channel and DM server GETs completed within the first second and new messages were visible in first-second screenshots; WS resumed after twelve seconds. Production bytes are unchanged at this head, so these finite runtime samples are associated by verified hashes; native QA was not rerun on the test-only commit. They do not prove physical-device cause, client-body timing or exact first paint.
  • Browser ordinary split parent/thread, released thread view, second-channel and DM operations pass with scoped HTTP/content. Browser hidden-state premise was not qualified, so browser foreground timing is unverified. QA services, emulator, forwards and owned browser pages are cleaned up.

Remaining runtime gaps: held-response account/target/permission transitions, native split foreground, iOS, physical devices and cross-device behavior. Normal tests cover owner fences and late-pagination races. Existing native-to-JS foreground signal delivery and probe budget remain unchanged. Merge authorized for this exact head with the listed limitations retained.

Checklist

  • Tests added/updated as needed
  • All CI checks pass
  • PR targets the correct branch

Impact Areas

  • Shared library (@alook/shared)
  • Web app (@alook/web)
  • App (@alook/app)
  • Email Worker (@alook/email-worker)
  • WebSocket DO (@alook/ws-do)
  • CI/CD
  • Other: none

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GenerQAQ
GenerQAQ marked this pull request as ready for review October 1, 2026 17:50
@GenerQAQ
GenerQAQ merged commit 37fbbc6 into main Oct 1, 2026
53 of 55 checks passed
@GenerQAQ
GenerQAQ deleted the fix/foreground-message-reconciliation branch October 1, 2026 17:58
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