Skip to content

Commit 9515f50

Browse files
authored
Merge branch 'main' into chore/tanstack-bump-5-70
2 parents b147676 + 6191e97 commit 9515f50

File tree

25 files changed

+573
-230
lines changed

25 files changed

+573
-230
lines changed

.changeset/sour-spiders-rhyme.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/attachments/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test": "pnpm build && vitest"
3030
},
3131
"peerDependencies": {
32-
"@powersync/common": "workspace:^1.26.0"
32+
"@powersync/common": "workspace:^1.27.0"
3333
},
3434
"devDependencies": {
3535
"@powersync/common": "workspace:*",

packages/common/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @powersync/common
22

3+
## 1.27.0
4+
5+
### Minor Changes
6+
7+
- b722378: Added `downloadError` and `uploadError` members to `SyncDataFlowStatus` of `SyncStatus`.
8+
39
## 1.26.0
410

511
### Minor Changes

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/common",
3-
"version": "1.26.0",
3+
"version": "1.27.0",
44
"publishConfig": {
55
"registry": "https://registry.npmjs.org/",
66
"access": "public"

packages/common/src/client/sync/stream/AbstractStreamingSyncImplementation.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ The next upload iteration will be delayed.`);
290290

291291
checkedCrudItem = nextCrudItem;
292292
await this.options.uploadCrud();
293+
this.updateSyncStatus({
294+
dataFlow: {
295+
uploadError: undefined
296+
}
297+
});
293298
} else {
294299
// Uploading is completed
295300
await this.options.adapter.updateLocalTarget(() => this.getWriteCheckpoint());
@@ -299,7 +304,8 @@ The next upload iteration will be delayed.`);
299304
checkedCrudItem = undefined;
300305
this.updateSyncStatus({
301306
dataFlow: {
302-
uploading: false
307+
uploading: false,
308+
uploadError: ex
303309
}
304310
});
305311
await this.delayRetry();
@@ -453,6 +459,12 @@ The next upload iteration will be delayed.`);
453459
this.logger.error(ex);
454460
}
455461

462+
this.updateSyncStatus({
463+
dataFlow: {
464+
downloadError: ex
465+
}
466+
});
467+
456468
// On error, wait a little before retrying
457469
await this.delayRetry();
458470
} finally {
@@ -588,7 +600,8 @@ The next upload iteration will be delayed.`);
588600
connected: true,
589601
lastSyncedAt: new Date(),
590602
dataFlow: {
591-
downloading: false
603+
downloading: false,
604+
downloadError: undefined
592605
}
593606
});
594607
}
@@ -688,7 +701,10 @@ The next upload iteration will be delayed.`);
688701
this.updateSyncStatus({
689702
connected: true,
690703
lastSyncedAt: new Date(),
691-
priorityStatusEntries: []
704+
priorityStatusEntries: [],
705+
dataFlow: {
706+
downloadError: undefined
707+
}
692708
});
693709
} else if (validatedCheckpoint === targetCheckpoint) {
694710
const result = await this.options.adapter.syncLocalDatabase(targetCheckpoint!);
@@ -707,7 +723,8 @@ The next upload iteration will be delayed.`);
707723
lastSyncedAt: new Date(),
708724
priorityStatusEntries: [],
709725
dataFlow: {
710-
downloading: false
726+
downloading: false,
727+
downloadError: undefined
711728
}
712729
});
713730
}

packages/common/src/db/crud/SyncStatus.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
export type SyncDataFlowStatus = Partial<{
22
downloading: boolean;
33
uploading: boolean;
4+
/**
5+
* Error during downloading (including connecting).
6+
*
7+
* Cleared on the next successful data download.
8+
*/
9+
downloadError?: Error;
10+
/**
11+
* Error during uploading.
12+
* Cleared on the next successful upload.
13+
*/
14+
uploadError?: Error;
415
}>;
516

617
export interface SyncPriorityStatus {
@@ -112,7 +123,7 @@ export class SyncStatus {
112123

113124
getMessage() {
114125
const dataFlow = this.dataFlowStatus;
115-
return `SyncStatus<connected: ${this.connected} connecting: ${this.connecting} lastSyncedAt: ${this.lastSyncedAt} hasSynced: ${this.hasSynced}. Downloading: ${dataFlow.downloading}. Uploading: ${dataFlow.uploading}`;
126+
return `SyncStatus<connected: ${this.connected} connecting: ${this.connecting} lastSyncedAt: ${this.lastSyncedAt} hasSynced: ${this.hasSynced}. Downloading: ${dataFlow.downloading}. Uploading: ${dataFlow.uploading}. UploadError: ${dataFlow.uploadError}, DownloadError?: ${dataFlow.downloadError}>`;
116127
}
117128

118129
toJSON(): SyncStatusOptions {

packages/drizzle-driver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test": "vitest"
2727
},
2828
"peerDependencies": {
29-
"@powersync/common": "workspace:^1.26.0",
29+
"@powersync/common": "workspace:^1.27.0",
3030
"drizzle-orm": "<1.0.0"
3131
},
3232
"devDependencies": {

packages/kysely-driver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test": "pnpm build && vitest"
2727
},
2828
"peerDependencies": {
29-
"@powersync/common": "workspace:^1.26.0"
29+
"@powersync/common": "workspace:^1.27.0"
3030
},
3131
"dependencies": {
3232
"kysely": "^0.27.4"

packages/node/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @powersync/node
22

3+
## 0.2.1
4+
5+
### Patch Changes
6+
7+
- 1c2ee86: Update README with common installation issues section
8+
- Updated dependencies [b722378]
9+
- @powersync/common@1.27.0
10+
311
## 0.2.0
412

513
### Minor Changes

packages/node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/node",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"publishConfig": {
55
"registry": "https://registry.npmjs.org/",
66
"access": "public"
@@ -44,7 +44,7 @@
4444
},
4545
"homepage": "https://docs.powersync.com/",
4646
"peerDependencies": {
47-
"@powersync/common": "workspace:^1.26.0"
47+
"@powersync/common": "workspace:^1.27.0"
4848
},
4949
"dependencies": {
5050
"@powersync/better-sqlite3": "^0.1.1",

0 commit comments

Comments
 (0)