Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .changeset/fix-progressive-must-refetch.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/quick-tables-glow.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/react/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.1.24",
"dependencies": {
"@tanstack/electric-db-collection": "^0.2.20",
"@tanstack/electric-db-collection": "^0.2.21",
"@tanstack/query-core": "^5.90.15",
"@tanstack/query-db-collection": "^1.0.12",
"@tanstack/react-db": "^0.1.60",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.33",
"dependencies": {
"@tanstack/electric-db-collection": "^0.2.20",
"@tanstack/electric-db-collection": "^0.2.21",
"@tanstack/query-core": "^5.90.15",
"@tanstack/query-db-collection": "^1.0.12",
"@tanstack/solid-db": "^0.1.59",
Expand Down
14 changes: 14 additions & 0 deletions packages/electric-db-collection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @tanstack/electric-db-collection

## 0.2.21

### Patch Changes

- Fix orphan transactions after `must-refetch` in progressive sync mode ([#1069](https://github.com/TanStack/db/pull/1069))

When a `must-refetch` message was received in progressive mode, it started a transaction with `truncate()` but reset `hasReceivedUpToDate`, causing subsequent messages to be buffered instead of written to the existing transaction. On `up-to-date`, the atomic swap code would create a new transaction, leaving the first one uncommitted forever. This caused collections to become corrupted with undefined values.

The fix ensures that when a transaction is already started (e.g., from must-refetch), messages are written directly to it instead of being buffered for atomic swap.

- Fix duplicate key error when overlapping subset queries return the same row with different values. ([#1070](https://github.com/TanStack/db/pull/1070))

When multiple subset queries return the same row (e.g., different WHERE clauses that both match the same record), the server sends `insert` operations for each response. If the row's data changed between requests (e.g., timestamp field updated), this caused a `DuplicateKeySyncError`. The adapter now tracks synced keys and converts subsequent inserts to updates.

## 0.2.20

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/electric-db-collection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/electric-db-collection",
"version": "0.2.20",
"version": "0.2.21",
"description": "ElectricSQL collection for TanStack DB",
"author": "Kyle Mathews",
"license": "MIT",
Expand Down
6 changes: 2 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.