@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.cjs
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
|
}
|
|
@@ -10975,7 +10979,7 @@ function requireDist () {
|
|
|
10975
10979
|
|
|
10976
10980
|
var distExports = requireDist();
|
|
10977
10981
|
|
|
10978
|
-
var version = "1.57.
|
|
10982
|
+
var version = "1.57.3";
|
|
10979
10983
|
var PACKAGE = {
|
|
10980
10984
|
version: version};
|
|
10981
10985
|
|
|
@@ -11589,6 +11593,9 @@ class AbstractRemote {
|
|
|
11589
11593
|
if (!res.ok || !res.body) {
|
|
11590
11594
|
const text = await res.text();
|
|
11591
11595
|
this.logger.error(`Could not POST streaming to ${path} - ${res.status} - ${res.statusText}: ${text}`);
|
|
11596
|
+
if (res.status === 401) {
|
|
11597
|
+
this.invalidateCredentials();
|
|
11598
|
+
}
|
|
11592
11599
|
const error = new Error(`HTTP ${res.statusText}: ${text}`);
|
|
11593
11600
|
error.status = res.status;
|
|
11594
11601
|
throw error;
|
|
@@ -11845,6 +11852,7 @@ class AbstractStreamingSyncImplementation extends BaseObserver {
|
|
|
11845
11852
|
async _uploadAllCrud(signal) {
|
|
11846
11853
|
return this.obtainLock({
|
|
11847
11854
|
type: exports.LockType.CRUD,
|
|
11855
|
+
signal,
|
|
11848
11856
|
callback: async () => {
|
|
11849
11857
|
/**
|
|
11850
11858
|
* Keep track of the first item in the CRUD queue for the last `uploadCrud` iteration.
|
|
@@ -13469,7 +13477,7 @@ SELECT * FROM crud_entries;
|
|
|
13469
13477
|
}
|
|
13470
13478
|
/**
|
|
13471
13479
|
* Open a read-only transaction.
|
|
13472
|
-
*
|
|
13480
|
+
* When multiple connections are available, read transactions can run concurrently to a write transaction.
|
|
13473
13481
|
* Changes from any write transaction are not visible to read transactions started before it.
|
|
13474
13482
|
*
|
|
13475
13483
|
* @param callback - Function to execute within the transaction
|