Repository navigation
fix: eliminate full-catalog tab projections on mutations and fix Team sidebar liveness probes - #724
Merged
Merged
Conversation
… sidebar liveness probes
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR replaces full-catalog work after tab mutations with targeted reads and incremental cache updates.
No actionable issues were found. This review checked source and tests; it did not run tests. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Person tab command] --> B[executeCommand]
B --> C[TabStore mutation]
C --> D{Replayed?}
D -->|No| E[Project affected tabs]
E --> F[Update cached rows and layout]
D -->|Yes| G[Use current layout]
F --> H[Return command result]
G --> H
I[Sidebar subscribe or probe] --> J[Build sidebar]
J --> K{Access revision changed?}
K -->|Yes| L[Check access and rebuild]
L --> K
K -->|No| M[Send sidebar]
Reviews (1) · Last reviewed commit: "fix: eliminate full-catalog tab projecti..." · Reviewed by Greptile |
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.
Summary
Fixes the root architectural causes behind slow/hanging local tab mutations and the Team realtime 35.5 s reconnect storm:
1. Targeted Tab Mutations, Incremental Catalog Maintenance, and Batched Projection
apps/host/src/server.ts&apps/host/src/tabs/tab-service.ts:TabService.executeCommand(ownerId, command)as the single person-command entry point, using the committedlayoutreturned directly byTabStoremutations instead of running redundant full-catalogtabs.project()calls aftertab.close,tab.open,tab.organize, andtab.group.update.this.changed(ownerId)) on mutations with incremental catalog updates (#applyCatalogMutation) fenced by per-rowrowVersions, per-tab invalidation versions (dirty: Map<TabId, number> | null), andstructureEpochso concurrent refreshes, activations, mid-projection invalidations, and post-commit failures remain coherent.get(),activate(),open(),reopen(),organize(),updateGroup(),deleteGroup(), andauthorizeShow()project only the affected tab(s) rather than allNtabs, while sharing a singlemaskVisibleLayouthelper for partial-reach group masking.N+1andO(N^2)work in#projectRows: buildslayoutGroupMaponce (O(N)), reusescomputer.selfRunnerId(deduplicating fallbackrequireDeviceSelfRunnerIdper device), deduplicatesapps.getperappId, and batches native window state checks viaNativeTabTargets.windowStates.packages/database/src/tab-store.ts:replayed: trueandcurrentLayouton idempotent command replays, and passesreplayedTabIdsintoTabAuthorizationso:tab.closeafter reopen/activate never terminates the reopened tab's viewer generation;tab.reopenwithouttabIdauthorizes against the originally reopened tab;pages.admittedon replayed page opens).apps/host/src/tabs/ports.ts&apps/host/src/computer-use/native-tab-targets.ts:windowStates(ownerId, windows)batch projection (oneownsper unique computer, oneconnections(ownerId)per batch, one connectivity cut, andviews.listonly for connected owned computers with approved apps) and unifiedwindowStateonto the same path.#observedwith LRU touch-on-read (defaultMaxObservedWindows = 2048>tabsMaxPerOwner), bounded concurrent background probes per computer (defaultMaxConcurrentWindowProbesPerComputer = 8), centralized in-flight probe supersession inside#rememberObserved, and scoped unavailable-eviction recovery tracking per computer.2. Team Realtime Idle Liveness Probes & Access-Fence Safety
apps/host/src/team/realtime.ts:team.subscribeliveness probes (subscriptionId: "sidebar",sidebar: true,scope: null) withteam.sidebarwhile keeping channel/thread subscribes and unsubscribes free of redundant sidebar snapshots—eliminating the 35.5 s idle reconnect loop and restoringteam.access.changedsidebar recovery.#sendSidebar(peer)sothis.access.handoffre-authorizes and rebuilds the sidebar at the current revision if access changes betweendirectory()capture and delivery (preventing stale private-channel leaks across subscribe, probe, and resync).Verification
pnpm --filter @opensteer/database typecheck&pnpm --filter @opensteer/host typecheck— passedpnpm exec prettier --check&pnpm exec oxlinton all modified files — 0 warnings, 0 errorstab-service.test.ts,native-tab-binding.test.ts,realtime.test.ts) — 32/32 passedtab-store.integration.test.ts,tab-authority.integration.test.ts,coordination.integration.test.ts,browser-source-journey.integration.test.ts) — all passedgpt-6.2-sol(reasoningEffort: high) — signed off (Ship)