feat(typescript-client): add move-in event support#4043
Merged
Conversation
…Pattern to MovePattern Extend EventMessage to accept both move-out and move-in events, add active_conditions to ChangeMessage headers, and rename MoveOutPattern to MovePattern (with deprecated alias for backwards compat). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4043 +/- ##
==========================================
+ Coverage 85.78% 88.67% +2.88%
==========================================
Files 51 25 -26
Lines 3399 2438 -961
Branches 611 613 +2
==========================================
- Hits 2916 2162 -754
+ Misses 481 274 -207
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
kevin-dp
added a commit
to TanStack/db
that referenced
this pull request
Mar 23, 2026
Switch to the preview package from electric-sql/electric#4043 so that move-in event types are available without unsafe casts in tests. NOTE: replace the preview URL with the released version before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kevin-dp
added a commit
to TanStack/db
that referenced
this pull request
Mar 23, 2026
Switch to the preview package from electric-sql/electric#4043 so that move-in event types are available without unsafe casts in tests. NOTE: replace the preview URL with the released version before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kevin-dp
added a commit
to TanStack/db
that referenced
this pull request
Mar 30, 2026
Switch to the preview package from electric-sql/electric#4043 so that move-in event types are available without unsafe casts in tests. NOTE: replace the preview URL with the released version before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
robacourt
approved these changes
Mar 30, 2026
Contributor
|
This PR has been released! 🚀 The following packages include changes from this PR:
Thanks for contributing to Electric! |
kevin-dp
added a commit
to TanStack/db
that referenced
this pull request
Mar 31, 2026
* feat(electric-db-collection): add DNF/active_conditions support for arbitrary boolean WHERE clauses Support the new Electric server wire protocol (PR electric-sql/electric#3791): - Change tag delimiter from `|` to `/`, replace `_` wildcards with empty segments (NON_PARTICIPATING positions) - Add `active_conditions` header support for DNF visibility evaluation - Shapes with subquery dependencies use DNF: a row is visible if ANY disjunct has ALL its positions satisfied in active_conditions - Simple shapes (no subquery dependencies) retain existing behavior: row deleted when tag set becomes empty - Derive disjunct_positions once per shape (not per-row like the Elixir client) since the DNF structure is fixed by the WHERE clause Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: apply automated fixes * chore: add changeset for DNF/active_conditions support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(electric-db-collection): add move-in support and rename MoveOutPattern to MovePattern - Rename MoveOutPattern to MovePattern in tag-index.ts and electric.ts - Add isMoveInMessage() type guard - Add processMoveInEvent(): re-activates conditions for matching rows (silent operation, no messages emitted to collection) - Refactor move-out in DNF mode to preserve tag index entries for visible rows, so move-in can find them to re-activate positions - Handle move-in in message loop and progressive mode atomic swap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(electric-db-collection): add move-in and DNF coverage tests Add tests ported from the Elixir client's tag_tracker_test.exs: - Move-in activates correct positions - Move-out → move-in → move-out full lifecycle cycle - Deleted rows not resurrected by move-in (tag index cleaned up) - Orphaned tag index entries don't cause phantom deletes - Deleted row cleans up ALL tag index entries - Multiple patterns deactivating same row in one call - Unit tests for parseTag, rowVisible, and deriveDisjunctPositions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: use preview @electric-sql/client with move-in support Switch to the preview package from electric-sql/electric#4043 so that move-in event types are available without unsafe casts in tests. NOTE: replace the preview URL with the released version before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: apply automated fixes * Update electric-sql/client version * Bump electric-sql/client version --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
balegas
pushed a commit
that referenced
this pull request
Mar 31, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
balegas
pushed a commit
that referenced
this pull request
Apr 1, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
balegas
pushed a commit
that referenced
this pull request
Apr 2, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
No description provided.