Repository navigation
Conversation
…(NEXT.md 3.5) Adds multitab-sync.ts owning the dominic:registry-sync channel: registry mutations broadcast a plain-object snapshot through the existing onRegistryChange API, receiving tabs apply it via the new registry importApps() (which persists + notifies like a local mutation). Echoes are ignored by instance id; app source stays out of the channel (shared localStorage VFS). Wired once in app.vue onMounted; SSR-safe. Window geometry/focus/workspaces are per-tab shell state and are not synced (NEXT.md 2.5 owns their persistence). Recorded as ADR 0016 (accepted), superseding ADR 0003's deferral without editing that record. e2e covers install and uninstall fan-out across tabs. Closes #116
m-vawter
requested changes
Oct 23, 2026
m-vawter
left a comment
Collaborator
There was a problem hiding this comment.
Jumping in since the new spec is in my lane. I ran it merged into current main in a clean container. Your two specs pass, and a single install does show up in the other tab. But the sync never settles, and it loses installs:
- Echo loop. A tab ignores only its own
instanceId. Importing a snapshot callsimportApps(), which callsnotify(). That fires this tab'sonRegistryChangelistener, which broadcasts the snapshot back. So two open tabs ping-pong forever. After one install with two tabs open, a third listener ondominic:registry-synccounted 1,863 messages in the first second and 6,914 after four, and every message rewritesregistry.json. Fix: don't rebroadcast while applying a remote snapshot (a guard flag aroundimportApps, or anoriginargument onnotify). Or broadcast only local mutations:registerAppandunregisterApp, notimportApps. - Installs get lost. Two tabs installing different apps at nearly the same moment ended with the tabs disagreeing and
registry.jsonholding only one of the two, a different one on each run. Even two seconds apart, the persisted registry ended with just one app while both tabs still showed both, so a reload would drop one. The loop drives this: whichever snapshot arrives last overwrites. And becauseapplyRemoteAppsreplaces the whole registry, a stale snapshot can delete an app the other tab just added. Itsremovedlist is computed and then discarded (void removed). Merging by id withupdatedAt, with deletes sent as explicit messages, would fix that.
Tests (my lane): please add two guards: the channel goes quiet after one install (for example, a listener counts no more than a few messages), and two tabs installing different apps both survive a reload. I'm happy to send probe code if useful.
Nits:
- the comment says
startRegistrySyncreturns a stop function, but it returnsvoid; - the
applyRemoteAppscomment describes an entry-file check the code doesn't do.
P.S. The Phase 0 release notes are up as #133, a CHANGELOG.md. If you'd rather have a GitHub release, say so and I'll move them.
This was referenced Oct 23, 2026
Open
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.
Closes #116
What
egistry.ts: \importApps(metas)\ replaces in-memory registry state, persists, notifies (public API only; \�fs.ts\ untouched — Charles owns that seam in 1.1 Async VirtualFileSystem + driver registry (localStorage system, IndexedDB apps, migration) #105).
Scope match
Exactly the union of #116's ## Files\ as amended on the issue: app/features/shared/, app/features/apps/, app/features/os/** (read-only check), docs/adrs/, tests/e2e/, app/app.vue.
Not in scope
Window geometry/focus/workspace sync — per-tab shell state; NEXT.md 2.5 (#113) owns their persistence.