@powersync/common 1.53.0 → 1.53.1

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.
@@ -8132,7 +8132,7 @@ function requireDist () {
8132
8132
 
8133
8133
  var distExports = requireDist();
8134
8134
 
8135
- var version = "1.53.0";
8135
+ var version = "1.53.1";
8136
8136
  var PACKAGE = {
8137
8137
  version: version};
8138
8138
 
@@ -8316,6 +8316,7 @@ function injectable(source) {
8316
8316
  let waiter = undefined; // An active, waiting next() call.
8317
8317
  // A pending upstream event that couldn't be dispatched because inject() has been called before it was resolved.
8318
8318
  let pendingSourceEvent = null;
8319
+ let sourceFetchInFlight = false;
8319
8320
  let pendingInjectedEvents = [];
8320
8321
  const consumeWaiter = () => {
8321
8322
  const pending = waiter;
@@ -8324,6 +8325,7 @@ function injectable(source) {
8324
8325
  };
8325
8326
  const fetchFromSource = () => {
8326
8327
  const resolveWaiter = (propagate) => {
8328
+ sourceFetchInFlight = false;
8327
8329
  const active = consumeWaiter();
8328
8330
  if (active) {
8329
8331
  propagate(active);
@@ -8332,6 +8334,7 @@ function injectable(source) {
8332
8334
  pendingSourceEvent = propagate;
8333
8335
  }
8334
8336
  };
8337
+ sourceFetchInFlight = true;
8335
8338
  const nextFromSource = source.next();
8336
8339
  nextFromSource.then((value) => {
8337
8340
  sourceIsDone = value.done == true;
@@ -8358,7 +8361,9 @@ function injectable(source) {
8358
8361
  }
8359
8362
  // Nothing pending? Fetch from source
8360
8363
  waiter = { resolve, reject };
8361
- return fetchFromSource();
8364
+ if (!sourceFetchInFlight) {
8365
+ fetchFromSource();
8366
+ }
8362
8367
  });
8363
8368
  },
8364
8369
  inject: (event) => {