@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.
@@ -2392,12 +2392,16 @@ class ControlledExecutor {
2392
2392
  }
2393
2393
  async execute(param) {
2394
2394
  this.runningTask = this.task(param);
2395
- await this.runningTask;
2396
- this.runningTask = undefined;
2397
- if (this.pendingTaskParam) {
2398
- const pendingParam = this.pendingTaskParam;
2399
- this.pendingTaskParam = undefined;
2400
- this.execute(pendingParam);
2395
+ try {
2396
+ await this.runningTask;
2397
+ }
2398
+ finally {
2399
+ this.runningTask = undefined;
2400
+ if (this.pendingTaskParam) {
2401
+ const pendingParam = this.pendingTaskParam;
2402
+ this.pendingTaskParam = undefined;
2403
+ this.execute(pendingParam);
2404
+ }
2401
2405
  }
2402
2406
  }
2403
2407
  }
@@ -8606,7 +8610,7 @@ function requireDist () {
8606
8610
 
8607
8611
  var distExports = requireDist();
8608
8612
 
8609
- var version = "1.57.1";
8613
+ var version = "1.57.3";
8610
8614
  var PACKAGE = {
8611
8615
  version: version};
8612
8616
 
@@ -9220,6 +9224,9 @@ class AbstractRemote {
9220
9224
  if (!res.ok || !res.body) {
9221
9225
  const text = await res.text();
9222
9226
  this.logger.error(`Could not POST streaming to ${path} - ${res.status} - ${res.statusText}: ${text}`);
9227
+ if (res.status === 401) {
9228
+ this.invalidateCredentials();
9229
+ }
9223
9230
  const error = new Error(`HTTP ${res.statusText}: ${text}`);
9224
9231
  error.status = res.status;
9225
9232
  throw error;
@@ -9476,6 +9483,7 @@ class AbstractStreamingSyncImplementation extends BaseObserver {
9476
9483
  async _uploadAllCrud(signal) {
9477
9484
  return this.obtainLock({
9478
9485
  type: exports.LockType.CRUD,
9486
+ signal,
9479
9487
  callback: async () => {
9480
9488
  /**
9481
9489
  * Keep track of the first item in the CRUD queue for the last `uploadCrud` iteration.
@@ -11100,7 +11108,7 @@ SELECT * FROM crud_entries;
11100
11108
  }
11101
11109
  /**
11102
11110
  * Open a read-only transaction.
11103
- * Read transactions can run concurrently to a write transaction.
11111
+ * When multiple connections are available, read transactions can run concurrently to a write transaction.
11104
11112
  * Changes from any write transaction are not visible to read transactions started before it.
11105
11113
  *
11106
11114
  * @param callback - Function to execute within the transaction