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