Skip to content

Commit db84156

Browse files
authored
Merge branch 'main' into improve-database-comments
2 parents bf1a63b + 6191e97 commit db84156

File tree

27 files changed

+2602
-2763
lines changed

27 files changed

+2602
-2763
lines changed

demos/angular-supabase-todolist/angular.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
"customWebpackConfig": {
2121
"path": "./extra-webpack.config.js"
2222
},
23-
"allowedCommonJsDependencies": [
24-
"js-logger",
25-
"ws"
26-
],
23+
"allowedCommonJsDependencies": ["js-logger", "ws"],
2724
"outputPath": "dist",
2825
"index": "src/index.html",
2926
"main": "src/main.ts",
@@ -39,7 +36,7 @@
3936
{
4037
"type": "initial",
4138
"maximumWarning": "500kb",
42-
"maximumError": "5mb"
39+
"maximumError": "6mb"
4340
},
4441
{
4542
"type": "anyComponentStyle",

demos/angular-supabase-todolist/package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^18.1.1",
18-
"@angular/common": "^18.1.1",
19-
"@angular/compiler": "^18.1.1",
20-
"@angular/core": "^18.1.1",
21-
"@angular/forms": "^18.1.1",
22-
"@angular/platform-browser": "^18.1.1",
23-
"@angular/platform-browser-dynamic": "^18.1.1",
24-
"@angular/router": "^18.1.1",
25-
"@angular/service-worker": "^18.1.1",
17+
"@angular/animations": "^19.2.4",
18+
"@angular/common": "^19.2.4",
19+
"@angular/compiler": "^19.2.4",
20+
"@angular/core": "^19.2.4",
21+
"@angular/forms": "^19.2.4",
22+
"@angular/platform-browser": "^19.2.4",
23+
"@angular/platform-browser-dynamic": "^19.2.4",
24+
"@angular/router": "^19.2.4",
25+
"@angular/service-worker": "^19.2.4",
2626
"@journeyapps/wa-sqlite": "^1.2.0",
2727
"@powersync/web": "workspace:*",
2828
"@supabase/supabase-js": "^2.44.4",
2929
"rxjs": "~7.8.1",
3030
"tslib": "^2.6.3",
31-
"zone.js": "~0.14.8"
31+
"zone.js": "~0.15.0"
3232
},
3333
"devDependencies": {
34-
"@angular-builders/custom-webpack": "^18.0.0",
35-
"@angular-devkit/build-angular": "^18.1.1",
36-
"@angular/cli": "^18.1.1",
37-
"@angular/compiler-cli": "^18.1.1",
34+
"@angular-builders/custom-webpack": "^19.0.0",
35+
"@angular-devkit/build-angular": "^19.2.5",
36+
"@angular/cli": "^19.2.5",
37+
"@angular/compiler-cli": "^19.2.4",
3838
"dotenv": "^16.4.5",
3939
"http-server": "^14.1.1",
4040
"typescript": "~5.5.3"

packages/attachments/package.json

+1-1
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

+6
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

+1-1
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

+21-4
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

+12-1
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 {
@@ -148,7 +159,7 @@ export class SyncStatus {
148159
*/
149160
getMessage() {
150161
const dataFlow = this.dataFlowStatus;
151-
return `SyncStatus<connected: ${this.connected} connecting: ${this.connecting} lastSyncedAt: ${this.lastSyncedAt} hasSynced: ${this.hasSynced}. Downloading: ${dataFlow.downloading}. Uploading: ${dataFlow.uploading}`;
162+
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}>`;
152163
}
153164

154165
/**

packages/drizzle-driver/package.json

+1-1
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

+1-1
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

+8
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/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ npm install @powersync/node
2626
Both `@powersync/node` and the `better-sqlite3` packages have install scripts that need to run to compile
2727
or download sqlite3 and PowerSync binaries.
2828

29+
### Common Installation Issues
30+
31+
The `better-sqlite` package requires native compilation, which depends on certain system tools. This compilation process is handled by `node-gyp` and may fail if required dependencies are missing or misconfigured.
32+
33+
#### Node-gyp Version Conflicts
34+
35+
`better-sqlite` depends on `node-gyp@^11`, but some project configurations may introduce multiple versions of `node-gyp`, potentially causing build issues.
36+
37+
#### Python Dependency Issues
38+
39+
`node-gyp` requires Python for compilation. If your project uses `node-gyp` below version `10` and your system has Python `3.12` or later, you may encounter the following error:
40+
41+
```python
42+
ModuleNotFoundError: No module named 'distutils'
43+
```
44+
45+
To resolve this, either:
46+
47+
- Upgrade `node-gyp` to version 10 or later.
48+
- Install Python [setuptools](https://pypi.org/project/setuptools/), which includes `distutils`.
49+
2950
# Getting Started
3051

3152
The [Node.js SDK reference](https://docs.powersync.com/client-sdk-references/node)

packages/node/package.json

+2-2
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",

packages/powersync-op-sqlite/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @powersync/op-sqlite
22

3+
## 0.5.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b722378]
8+
- @powersync/common@1.27.0
9+
310
## 0.5.0
411

512
### Minor Changes

packages/powersync-op-sqlite/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/op-sqlite",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "PowerSync - sync Postgres or MongoDB with SQLite in your React Native app for offline-first and real-time data",
55
"source": "./src/index.ts",
66
"main": "./lib/commonjs/index.js",
@@ -66,7 +66,7 @@
6666
},
6767
"peerDependencies": {
6868
"@op-engineering/op-sqlite": "^11.2.13",
69-
"@powersync/common": "workspace:^1.26.0",
69+
"@powersync/common": "workspace:^1.27.0",
7070
"react": "*",
7171
"react-native": "*"
7272
},

packages/react-native/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @powersync/react-native
22

3+
## 1.19.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b722378]
8+
- @powersync/common@1.27.0
9+
- @powersync/react@1.5.2
10+
311
## 1.19.0
412

513
### Minor Changes

packages/react-native/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/react-native",
3-
"version": "1.19.0",
3+
"version": "1.19.1",
44
"publishConfig": {
55
"registry": "https://registry.npmjs.org/",
66
"access": "public"
@@ -31,7 +31,7 @@
3131
"homepage": "https://docs.powersync.com/",
3232
"peerDependencies": {
3333
"@journeyapps/react-native-quick-sqlite": "^2.4.2",
34-
"@powersync/common": "workspace:^1.26.0",
34+
"@powersync/common": "workspace:^1.27.0",
3535
"react": "*",
3636
"react-native": "*"
3737
},

packages/react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://docs.powersync.com",
3131
"peerDependencies": {
32-
"@powersync/common": "workspace:^1.26.0",
32+
"@powersync/common": "workspace:^1.27.0",
3333
"react": "*"
3434
},
3535
"devDependencies": {

packages/tanstack-react-query/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @powersync/tanstack-react-query
22

3+
## 0.0.18
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b722378]
8+
- @powersync/common@1.27.0
9+
- @powersync/react@1.5.2
10+
311
## 0.0.17
412

513
### Patch Changes

packages/tanstack-react-query/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@powersync/tanstack-react-query",
3-
"version": "0.0.17",
3+
"version": "0.0.18",
44
"publishConfig": {
55
"registry": "https://registry.npmjs.org/",
66
"access": "public"
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://docs.powersync.com",
3131
"peerDependencies": {
32-
"@powersync/common": "workspace:^1.26.0",
32+
"@powersync/common": "workspace:^1.27.0",
3333
"react": "*"
3434
},
3535
"dependencies": {

packages/vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"homepage": "https://docs.powersync.com",
3131
"peerDependencies": {
3232
"vue": "*",
33-
"@powersync/common": "workspace:^1.26.0"
33+
"@powersync/common": "workspace:^1.27.0"
3434
},
3535
"devDependencies": {
3636
"@powersync/common": "workspace:*",

packages/web/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @powersync/web
22

3+
## 1.17.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b722378]
8+
- @powersync/common@1.27.0
9+
310
## 1.17.0
411

512
### Minor Changes

0 commit comments

Comments
 (0)