Skip to content

feat: live multiuser data propagation (#11) - #19

Merged
DDecoene merged 13 commits into
release/v1.1.0from
feature/live-multiuser-propagation
Jun 27, 2026
Merged

feat: live multiuser data propagation (#11)#19
DDecoene merged 13 commits into
release/v1.1.0from
feature/live-multiuser-propagation

Conversation

@DDecoene

Copy link
Copy Markdown
Owner

Closes #11.

When one session mutates a table, every other session currently BROWSE-ing that same table refreshes automatically — no manual re-query. Type in one browser window, watch another repaint.

How it works

  • Prereq fix: ServerDatabaseBridge.closeDatabase() is now detach-only — it no longer closes the SQLite handle shared across sessions (one user closing a DB previously broke everyone else's queries).
  • Mutation signal: exec() fires an onMutate hook → Session marks itself dirty → after the message it calls a notifyChange callback injected by SessionManager. Every write path (REPLACE/APPEND/DELETE/PACK/grid edits) routes through exec(), so no per-command bookkeeping.
  • Fan-out: SessionManager.broadcast(db, table, except) sends a new data-changed message only to sessions whose current view matches (server-side relevance filter), debounced per table so a burst coalesces into one refresh.
  • Client: Terminal handles data-changed and, if a Grid is open on that table, triggers the existing F5 refresh path (repaints in place, preserves selection).

Tests

  • Unit: bridge onMutate + shared-handle regression; SessionManager broadcast filters by view, skips originator, coalesces a burst.
  • E2E (tests/propagation.spec.ts): two browser contexts both BROWSE the same table; edit in one, assert the other repaints with no re-query. Passes live.
  • Full suite: 206 tests green; tsc --noEmit clean.

Ships as v0.9.0. Design/plan under docs/superpowers/.

@DDecoene
DDecoene changed the base branch from main to release/v1.1.0 June 27, 2026 14:29
@DDecoene

Copy link
Copy Markdown
Owner Author

Update (GitFlow): re-based onto release/v1.1.0 and versioned as v1.1.0 (this is milestone v1.1.0 — beyond parity work, not a 0.x parity-track release). Per the new GitFlow policy, this PR merges into release/v1.1.0, not main; the v1.1.0 tag is cut only when that release branch merges to main. 206 tests green.

@DDecoene
DDecoene merged commit 8b40a34 into release/v1.1.0 Jun 27, 2026
1 check passed
@DDecoene
DDecoene deleted the feature/live-multiuser-propagation branch June 27, 2026 14:32
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.

Live multiuser propagation: broadcast data changes to other sessions

1 participant