Skip to content

Commit 1654c41

Browse files
KyleAMathewsclaude
andauthored
chore(electric-db-collection): update dependencies (#1381)
* chore(electric-db-collection): update dependencies Update @electric-sql/client, @tanstack/store, and pg to latest versions. Adapt subscription cleanup to @tanstack/store 0.9.x Subscription API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: align dependency versions across workspace for sherif Update @electric-sql/client, @tanstack/store, and pg versions in all packages to resolve sherif version mismatch errors. Fix trailbase-db-collection subscribe callback for @tanstack/store 0.9.x API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d351c67 commit 1654c41

File tree

15 files changed

+106
-89
lines changed

15 files changed

+106
-89
lines changed

.changeset/update-electric-deps.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@tanstack/electric-db-collection': patch
3+
'@tanstack/trailbase-db-collection': patch
4+
'@tanstack/react-db': patch
5+
'@tanstack/solid-db': patch
6+
'@tanstack/vue-db': patch
7+
'@tanstack/powersync-db-collection': patch
8+
'@tanstack/rxdb-db-collection': patch
9+
---
10+
11+
Update dependencies across workspace to resolve version mismatches: `@electric-sql/client` ^1.5.13, `@tanstack/store` ^0.9.2, `pg` ^8.20.0. Adapt subscription cleanup to `@tanstack/store` 0.9.x API which returns `Subscription` objects instead of unsubscribe functions.

examples/react/projects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dotenv": "^17.2.4",
3131
"drizzle-orm": "^0.45.1",
3232
"drizzle-zod": "^0.8.3",
33-
"pg": "^8.18.0",
33+
"pg": "^8.20.0",
3434
"react": "^19.2.4",
3535
"react-dom": "^19.2.4",
3636
"tailwindcss": "^4.1.18",

examples/react/todo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"eslint": "^9.39.2",
4141
"eslint-plugin-react-hooks": "^5.2.0",
4242
"eslint-plugin-react-refresh": "^0.4.26",
43-
"pg": "^8.18.0",
43+
"pg": "^8.20.0",
4444
"tsx": "^4.21.0",
4545
"typescript": "^5.9.2",
4646
"vite": "^7.3.0"

examples/solid/todo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"drizzle-kit": "^0.31.9",
3535
"eslint": "^9.39.2",
3636
"eslint-plugin-solid": "^0.14.5",
37-
"pg": "^8.18.0",
37+
"pg": "^8.20.0",
3838
"tsx": "^4.21.0",
3939
"typescript": "^5.9.2",
4040
"vite": "^7.3.0",

packages/db-collection-e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@tanstack/db": "workspace:*",
1414
"@tanstack/electric-db-collection": "workspace:*",
1515
"@tanstack/query-db-collection": "workspace:*",
16-
"pg": "^8.18.0"
16+
"pg": "^8.20.0"
1717
},
1818
"devDependencies": {
1919
"@types/pg": "^8.16.0",

packages/electric-db-collection/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@
4646
"src"
4747
],
4848
"dependencies": {
49-
"@electric-sql/client": "^1.5.12",
49+
"@electric-sql/client": "^1.5.13",
5050
"@standard-schema/spec": "^1.1.0",
5151
"@tanstack/db": "workspace:*",
52-
"@tanstack/store": "^0.8.0",
52+
"@tanstack/store": "^0.9.2",
5353
"debug": "^4.4.3"
5454
},
5555
"devDependencies": {
5656
"@types/debug": "^4.1.12",
5757
"@types/pg": "^8.16.0",
5858
"@vitest/coverage-istanbul": "^3.2.4",
59-
"pg": "^8.18.0"
59+
"pg": "^8.20.0"
6060
}
6161
}

packages/electric-db-collection/src/electric.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,26 +666,29 @@ export function electricCollectionOptions<T extends Row<unknown>>(
666666
if (hasSnapshot) return true
667667

668668
return new Promise((resolve, reject) => {
669+
const cleanup = () => {
670+
clearTimeout(timeoutId)
671+
subSeenTxids.unsubscribe()
672+
subSeenSnapshots.unsubscribe()
673+
}
674+
669675
const timeoutId = setTimeout(() => {
670-
unsubscribeSeenTxids()
671-
unsubscribeSeenSnapshots()
676+
cleanup()
672677
reject(new TimeoutWaitingForTxIdError(txId, config.id))
673678
}, timeout)
674679

675-
const unsubscribeSeenTxids = seenTxids.subscribe(() => {
680+
const subSeenTxids = seenTxids.subscribe(() => {
676681
if (seenTxids.state.has(txId)) {
677682
debug(
678683
`${config.id ? `[${config.id}] ` : ``}awaitTxId found match for txid %o`,
679684
txId,
680685
)
681-
clearTimeout(timeoutId)
682-
unsubscribeSeenTxids()
683-
unsubscribeSeenSnapshots()
686+
cleanup()
684687
resolve(true)
685688
}
686689
})
687690

688-
const unsubscribeSeenSnapshots = seenSnapshots.subscribe(() => {
691+
const subSeenSnapshots = seenSnapshots.subscribe(() => {
689692
const visibleSnapshot = seenSnapshots.state.find((snapshot) =>
690693
isVisibleInSnapshot(txId, snapshot),
691694
)
@@ -695,9 +698,7 @@ export function electricCollectionOptions<T extends Row<unknown>>(
695698
txId,
696699
visibleSnapshot,
697700
)
698-
clearTimeout(timeoutId)
699-
unsubscribeSeenSnapshots()
700-
unsubscribeSeenTxids()
701+
cleanup()
701702
resolve(true)
702703
}
703704
})

packages/powersync-db-collection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"dependencies": {
5555
"@standard-schema/spec": "^1.1.0",
5656
"@tanstack/db": "workspace:*",
57-
"@tanstack/store": "^0.8.0",
57+
"@tanstack/store": "^0.9.2",
5858
"debug": "^4.4.3",
5959
"p-defer": "^4.0.1"
6060
},

packages/react-db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"react": ">=16.8.0"
5454
},
5555
"devDependencies": {
56-
"@electric-sql/client": "^1.5.12",
56+
"@electric-sql/client": "^1.5.13",
5757
"@testing-library/react": "^16.3.2",
5858
"@types/react": "^19.2.13",
5959
"@types/react-dom": "^19.2.3",

packages/rxdb-db-collection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"dependencies": {
6565
"@standard-schema/spec": "^1.1.0",
6666
"@tanstack/db": "workspace:*",
67-
"@tanstack/store": "^0.8.0",
67+
"@tanstack/store": "^0.9.2",
6868
"debug": "^4.4.3",
6969
"rxdb": "16.21.1"
7070
},

0 commit comments

Comments
 (0)