@powersync/common 1.57.1 → 1.57.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +16 -8
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.mjs +16 -8
- package/dist/bundle.mjs.map +1 -1
- package/dist/bundle.node.cjs +16 -8
- package/dist/bundle.node.cjs.map +1 -1
- package/dist/bundle.node.mjs +16 -8
- package/dist/bundle.node.mjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/lib/client/AbstractPowerSyncDatabase.d.ts +1 -1
- package/lib/client/AbstractPowerSyncDatabase.js +1 -1
- package/lib/client/sync/stream/AbstractRemote.d.ts +2 -2
- package/lib/client/sync/stream/AbstractRemote.js +3 -0
- package/lib/client/sync/stream/AbstractRemote.js.map +1 -1
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +1 -0
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js.map +1 -1
- package/lib/utils/ControlledExecutor.js +10 -6
- package/lib/utils/ControlledExecutor.js.map +1 -1
- package/lib/utils/Logger.d.ts +7 -7
- package/lib/utils/Logger.js.map +1 -1
- package/package.json +1 -1
- package/src/client/AbstractPowerSyncDatabase.ts +1 -1
- package/src/client/sync/stream/AbstractRemote.ts +5 -1
- package/src/client/sync/stream/AbstractStreamingSyncImplementation.ts +1 -0
- package/src/utils/ControlledExecutor.ts +9 -6
- package/src/utils/Logger.ts +9 -1
package/dist/bundle.node.mjs
CHANGED
|
@@ -2390,12 +2390,16 @@ class ControlledExecutor {
|
|
|
2390
2390
|
}
|
|
2391
2391
|
async execute(param) {
|
|
2392
2392
|
this.runningTask = this.task(param);
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
this.
|
|
2398
|
-
this.
|
|
2393
|
+
try {
|
|
2394
|
+
await this.runningTask;
|
|
2395
|
+
}
|
|
2396
|
+
finally {
|
|
2397
|
+
this.runningTask = undefined;
|
|
2398
|
+
if (this.pendingTaskParam) {
|
|
2399
|
+
const pendingParam = this.pendingTaskParam;
|
|
2400
|
+
this.pendingTaskParam = undefined;
|
|
2401
|
+
this.execute(pendingParam);
|
|
2402
|
+
}
|
|
2399
2403
|
}
|
|
2400
2404
|
}
|
|
2401
2405
|
}
|
|
@@ -8604,7 +8608,7 @@ function requireDist () {
|
|
|
8604
8608
|
|
|
8605
8609
|
var distExports = requireDist();
|
|
8606
8610
|
|
|
8607
|
-
var version = "1.57.
|
|
8611
|
+
var version = "1.57.3";
|
|
8608
8612
|
var PACKAGE = {
|
|
8609
8613
|
version: version};
|
|
8610
8614
|
|
|
@@ -9218,6 +9222,9 @@ class AbstractRemote {
|
|
|
9218
9222
|
if (!res.ok || !res.body) {
|
|
9219
9223
|
const text = await res.text();
|
|
9220
9224
|
this.logger.error(`Could not POST streaming to ${path} - ${res.status} - ${res.statusText}: ${text}`);
|
|
9225
|
+
if (res.status === 401) {
|
|
9226
|
+
this.invalidateCredentials();
|
|
9227
|
+
}
|
|
9221
9228
|
const error = new Error(`HTTP ${res.statusText}: ${text}`);
|
|
9222
9229
|
error.status = res.status;
|
|
9223
9230
|
throw error;
|
|
@@ -9474,6 +9481,7 @@ class AbstractStreamingSyncImplementation extends BaseObserver {
|
|
|
9474
9481
|
async _uploadAllCrud(signal) {
|
|
9475
9482
|
return this.obtainLock({
|
|
9476
9483
|
type: LockType.CRUD,
|
|
9484
|
+
signal,
|
|
9477
9485
|
callback: async () => {
|
|
9478
9486
|
/**
|
|
9479
9487
|
* Keep track of the first item in the CRUD queue for the last `uploadCrud` iteration.
|
|
@@ -11098,7 +11106,7 @@ SELECT * FROM crud_entries;
|
|
|
11098
11106
|
}
|
|
11099
11107
|
/**
|
|
11100
11108
|
* Open a read-only transaction.
|
|
11101
|
-
*
|
|
11109
|
+
* When multiple connections are available, read transactions can run concurrently to a write transaction.
|
|
11102
11110
|
* Changes from any write transaction are not visible to read transactions started before it.
|
|
11103
11111
|
*
|
|
11104
11112
|
* @param callback - Function to execute within the transaction
|