Repository navigation
Move Tasks onto shared live reads - #6419
Merged
ymichael merged 2 commits intoOct 28, 2026
Merged
Conversation
Tasks kept its views live with its own query layer: a signal scheduler, patchers, snapshot revision guards, a refresh provider, a hand-written list edit layer and a 60 s pull request poll. The board read attachments with one RPC per card. Reads now declare tags and the UI uses experimental_useRpcQuery, experimental_useRpcKeyedQuery and experimental_useRpcMutation. The server replaces bb.realtime.publish with bb.rpc.experimental_invalidate in the domain handlers shared by RPC, CLI and agent tools. listAllTasks replaces the client page loop, listTaskCardMeta batches board card metadata, and the keyed labelsByProject read serves the all-projects list. A watched-read producer refreshes open pull requests every 60 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changing a task's parent or deleting a parent task promotes subtasks to board cards, but only invalidated task reads, so the promoted cards kept missing attachment counts and working-agent chips. Both paths now also invalidate the card metadata read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/tasks-plugin-onto-shared-live-reads-thr_b5b43iearn
branch
October 28, 2026 18:56
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Nov 2, 2026
Upstream: a4fdbe1 Move Tasks onto shared live reads (get-bb#6419) Base: 1a4a1d2 Release: 0.48.0 (top of upstream CHANGELOG at this commit) One conflict, plugins/tasks/views/detail/index.tsx (patch tasks-plugin): upstream moved useTasksQuery to the shared live-read form useTasksQuery("getTaskByKey", { taskKey }, selectTask). Kept Aleph's DetailViewBody wrapper (the onClose header) and switched its query to the new form. No other Aleph call site used the old callback form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Nov 2, 2026
Upstream get-bb#6419 moved Tasks change signals from realtime.publish to rpc.experimental_invalidate, so the Aleph test that counted realtime signals after async delivery saw none. It now asserts the comments tag invalidation, matching upstream's own delivery test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Tasks kept its views live with its own query layer instead of BB's shared live reads. That layer was a signal scheduler fed by four
useRealtimechannels (tasks/projects/comments/threads:changed), per-view patchers, snapshot revision guards, a refresh-generation provider, a hand-written list edit layer and a 60 s pull request poll. The board loaded card metadata with onelistAttachmentscall per card plus onelistTaskThreadscall per working task: 427 RPCs for a 400-card project. Every edit triggered 5–6 re-reads, each after the scheduler's 50 ms batching delay.I checked #5670's listed bugs on
mainagainst a seeded dev instance before porting:mainlistAttachmentsmain: activity re-read on every task change, and nothing in it depends on title or descriptionlistBbProjectsreads core data and refreshes on mount and reconnect, as beforePAR-01key miss is never refreshedWhat changed
No Plugin SDK change. Main's keyed reads don't need #5670's "seed cold keyed reads from a list response": the views use plain tagged list reads, so the first paint stays one round trip.
shared/contract.ts,shared/tags.ts):tags.listAllTasks: unpaged; replaces the client page loop.listTaskCardMeta: attachment counts and working agents for a project's cards in one read; replaces the per-card calls.labelsByProject: keyed by project,keyTags; serves the All tasks list's labels.api,delegate,lifecycle,attachments,cli):bb.realtime.publishbecomesbb.rpc.experimental_invalidatewith the matching tags.invalidates: the server would then broadcast twice, and the editing client would re-read twice.whileWatchedproducer onlistTaskPullRequestsreplaces the frontend 60 s poll. It refreshes a watched task's pull requests every 60 s while its last read had an open or draft PR.experimental_useRpcQuery. List labels for all projects useexperimental_useRpcKeyedQuery.experimental_useRpcMutationwith the shared optimistic cache. The dimmed pending rows come frompendingInputs.experimental_useRpcRefresh. It spins only for a manual refresh or a reconnect, as before.shell/signal-scheduler.ts,shell/refresh.tsx,views/list/optimistic.ts,views/list/use-task-edits.ts, the board/list patchers, snapshot revision guards, visibility handling and the detail PR interval.docs/api_to_audit.mdlists the Tasks producer under watched reads.Behaviour is the same for users. Changes that come from the shared cache:
mainshowed skeleton rows again. This is the repeat-visit behaviour Reload flashes: Tasks empty state, plugin route chrome, composer model and reasoning #1676 asked for.mainthey kept stale keys until the next task change.ok: false) shows its toast and re-reads the list to drop the prediction. It no longer rolls back locally first.sidebarOpenTaskCountis now a tagged read. Other plugins can read the open-task count live withexperimental_useRpcQuery({ pluginId: "tasks", … }), which is part of #5720's second ask.How you verified
pnpm exec turbo run typecheck lint test --filter='...[origin/main]' --continue:bb-plugin-tasks: 398/398.main, none new.@bb/appCommandPalette.test.tsx: a 10 s hook timeout; it passes alone, 71/71.@bb/serverbuiltin-plugin hot-reload fixture tests: they time out at load average 24–35.api/live-reads.test.tschecks that each write invalidates the tags of every read it must refresh and leaves the others alone:REV-03miss resolves whenREV-3is created.listAllTaskspast one page, andlistTaskCardMetacontents.api.test.ts: the producer refreshes every 60 s only while the PR is open, and stops when unwatched.experimental_invalidateRpcwith the tags the server sends. Tests of the deleted layer were removed:signal-scheduler,optimistic,incremental, the badge coalescing test and the first-connection test (that policy now belongs to core).Measured on a real dev instance (
pnpm start:worktree), same data on both builds: 480 tasks in one project, 50 with attachments, 5 attached threads. Each build ran in the same headless Chromium at 1600×1000. Medians, main → branch:The two optimistic rows (drag and priority menu) are both immediate on both builds, so their differences are noise. Counting
toLocaleDateStringcalls during load showed the list renders its rows fewer times than onmain(6,370 vs 10,226 calls). No edit triggered a double read.Driven in the running app on the branch:
bb tasks updatefrom the CLI updates an open detail view's title and activity live.PERF-0481) resolves oncePERF-481is created.🤖 Generated with Claude Code