@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 CHANGED
@@ -2390,12 +2390,16 @@ class ControlledExecutor {
2390
2390
  }
2391
2391
  async execute(param) {
2392
2392
  this.runningTask = this.task(param);
2393
- await this.runningTask;
2394
- this.runningTask = undefined;
2395
- if (this.pendingTaskParam) {
2396
- const pendingParam = this.pendingTaskParam;
2397
- this.pendingTaskParam = undefined;
2398
- this.execute(pendingParam);
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.1";
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
- * Read transactions can run concurrently to a write transaction.
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