Skip to content

fix(web): refresh chats on tab return and network recovery - #13

Merged
AgonSle merged 2 commits into
AgenticsWorks:mainfrom
AgonSle:codex/chat-refresh
Oct 20, 2026
Merged

AgonSle merged 2 commits into
AgenticsWorks:mainfrom
AgonSle:codex/chat-refresh

Conversation

@AgonSle

@AgonSle AgonSle commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Returning to a chat tab currently starts another 30–35 second timer, leaving already-saved replies invisible while the UI still says “Up to date.” This change refreshes immediately on tab visibility and network recovery, pauses polling while hidden/offline, and displays sync progress or the last successful sync time in English and Chinese.

The scheduler coalesces overlapping refreshes with a trailing request, preserves retry backoff, and invalidates work when a session ends. Browser regressions verify API replies and ACK receipts without a page reload, including visibility and connectivity events and duplicate-message checks.

Refs #12. Visible tabs retain the existing polling interval; browser WebSocket push remains a separate follow-up.

Browser fixtures cover the current automatic-pairing default, preserve explicit-approval coverage with a separate invitation, and check sender/recipient labels in the redesigned message layout. The responsive inspector behavior from current main is preserved.

Testing

  • npm run check and npm run build:app (dry run) passed.
  • node --test tests/chat-sync.test.mjs tests/i18n.test.mjs — 14 passed.
  • npm run test:sqlite — 46 passed.
  • npm run test:browser and npm run test:browser:server passed against disposable D1 and SQLite instances after integration with current main.
  • Local npm test — 150/151 passed on macOS. The remaining upstream onboarding fixture hardcodes /bin/true, which is absent on this Mac (/usr/bin/true exists). The fixture and onboarding implementation are unchanged in this PR.
  • GitHub CI for e7260ba — both verify and sqlite-backend passed, including the complete test suites.

@AgonSle
AgonSle merged commit a6d275d into AgenticsWorks:main Oct 20, 2026
2 checks passed
AgonSle added a commit to AgonSle/AgentPeerChat that referenced this pull request Oct 20, 2026
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