@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.mjs
CHANGED
|
@@ -2388,12 +2388,16 @@ class ControlledExecutor {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
async execute(param) {
|
|
2390
2390
|
this.runningTask = this.task(param);
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
this.
|
|
2396
|
-
this.
|
|
2391
|
+
try {
|
|
2392
|
+
await this.runningTask;
|
|
2393
|
+
}
|
|
2394
|
+
finally {
|
|
2395
|
+
this.runningTask = undefined;
|
|
2396
|
+
if (this.pendingTaskParam) {
|
|
2397
|
+
const pendingParam = this.pendingTaskParam;
|
|
2398
|
+
this.pendingTaskParam = undefined;
|
|
2399
|
+
this.execute(pendingParam);
|
|
2400
|
+
}
|
|
2397
2401
|
}
|
|
2398
2402
|
}
|
|
2399
2403
|
}
|
|
@@ -10973,7 +10977,7 @@ function requireDist () {
|
|
|
10973
10977
|
|
|
10974
10978
|
var distExports = requireDist();
|
|
10975
10979
|
|
|
10976
|
-
var version = "1.57.
|
|
10980
|
+
var version = "1.57.3";
|
|
10977
10981
|
var PACKAGE = {
|
|
10978
10982
|
version: version};
|
|
10979
10983
|
|
|
@@ -11587,6 +11591,9 @@ class AbstractRemote {
|
|
|
11587
11591
|
if (!res.ok || !res.body) {
|
|
11588
11592
|
const text = await res.text();
|
|
11589
11593
|
this.logger.error(`Could not POST streaming to ${path} - ${res.status} - ${res.statusText}: ${text}`);
|
|
11594
|
+
if (res.status === 401) {
|
|
11595
|
+
this.invalidateCredentials();
|
|
11596
|
+
}
|
|
11590
11597
|
const error = new Error(`HTTP ${res.statusText}: ${text}`);
|
|
11591
11598
|
error.status = res.status;
|
|
11592
11599
|
throw error;
|
|
@@ -11843,6 +11850,7 @@ class AbstractStreamingSyncImplementation extends BaseObserver {
|
|
|
11843
11850
|
async _uploadAllCrud(signal) {
|
|
11844
11851
|
return this.obtainLock({
|
|
11845
11852
|
type: LockType.CRUD,
|
|
11853
|
+
signal,
|
|
11846
11854
|
callback: async () => {
|
|
11847
11855
|
/**
|
|
11848
11856
|
* Keep track of the first item in the CRUD queue for the last `uploadCrud` iteration.
|
|
@@ -13467,7 +13475,7 @@ SELECT * FROM crud_entries;
|
|
|
13467
13475
|
}
|
|
13468
13476
|
/**
|
|
13469
13477
|
* Open a read-only transaction.
|
|
13470
|
-
*
|
|
13478
|
+
* When multiple connections are available, read transactions can run concurrently to a write transaction.
|
|
13471
13479
|
* Changes from any write transaction are not visible to read transactions started before it.
|
|
13472
13480
|
*
|
|
13473
13481
|
* @param callback - Function to execute within the transaction
|