Skip to content

fix: collaboration pixel timers - #3867

Open
kunal0137 wants to merge 8 commits into
devfrom
feat-collaboration-timers
Open

kunal0137 wants to merge 8 commits into
devfrom
feat-collaboration-timers

Conversation

@kunal0137

Copy link
Copy Markdown
Contributor

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes

…stop

- Remove useAgentAttention, agent-attention and waitForGeneratedRoomName
  (nothing imports them).
- One shared useNow clock for the dashboard header, day view and routine timer.
- Snooze wakes when the soonest snooze is due instead of re-running the
  reducer every 30 s in every tab.
- WorkBuildMenu no longer re-arms its poll after unmount.
- useJob backs off on errors (4 s up to 60 s) instead of retrying every 4 s.
- ConnectionsView clears its catch-up read timer on unmount.
- useVisibleResource moves to lib as the shared poll helper: per-caller wait
  (or one based on the last data), read-on-return gap, error backoff, no
  timers while hidden.
- Calendar every 5 min; an open email or event reads once; recent routine
  runs every 30 s only while one runs (3 min otherwise) and not while the
  nav is collapsed.
- Sources picker re-reads its mail list every 2 min, without folders.
- Brain-source rooms follow the page sync instead of a 30 s clock; Outlook
  rooms poll every 3 min; a tab return reads once.
- Sync progress every 3 s (10 s hidden); summaries, custom routines and
  delegations slow down in hidden tabs; room topics read twice per turn.
- A chat run waiting for approval polls every 5 s on screen, 30 s off
  screen, child runs every 10 s; opening the room or the tab wakes it.
… quiet sync

- Tabs share the sync clock (localStorage + a Web Lock); the tab that syncs
  tells the others over a BroadcastChannel, and they reload only when mail
  came in (or on return, when they were hidden).
- An automatic sync that brought nothing in re-reads the sync time only; a
  full reload still runs at least every 5 min, on Refresh, and after a send.
- A tab return reloads when the last full read is a minute old, not 15 s.
- The run inspector reads messages first and then only when the run moves;
  status every 3 s, 10 s while waiting for the owner, 15 s hidden.
- useVisibleResource keeps fresh data across pauses: turning a reader back
  on (moving into Today or a room, the palette) no longer re-reads at once.
- Recent routine runs stay mounted and pause while the nav is collapsed, so
  moving between rooms and pages does not remount and re-read them.
- Chat history merges back-to-back changes (new chat + first turn) into one
  re-read.
- Email rooms that follow the page sync no longer re-read on send as well;
  the sync's reload already does.
- The topic page reuses room links an earlier visit read in the last 2 min.
…ck stall

- useNow passed a new subscribe each render, so React resubscribed every
  render; subscribing ticked the clock and re-rendered again until React
  gave up and the app showed "could not start". Subscribe and getSnapshot
  are now stable per clock and subscribing no longer notifies.
- A tab still syncing no longer claims the shared minute (the claim pushed
  the clock forward and held every tab off), and a future time is ignored.
@kunal0137
kunal0137 requested a review from a team as a code owner November 6, 2026 13:19
@snyk-io

snyk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kunal0137
kunal0137 force-pushed the feat-collaboration-timers branch from f7d88d3 to affb11c Compare November 6, 2026 17:37
… storage, poll rooms in view

- A quiet sync now checks each tab's own full-read age, so a second
  visible tab no longer stays stale until it is focused.
- shared-sync keeps an in-memory last attempt, so the one-minute throttle
  holds when localStorage is unavailable.
- The waiting-run poll uses the fast rate only while a room view is
  subscribed to its session, not for every retained session.
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