@powersync/web 1.38.0 → 1.38.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.
@@ -13546,7 +13546,7 @@ function requireDist () {
13546
13546
 
13547
13547
  var distExports = requireDist();
13548
13548
 
13549
- var version = "1.53.0";
13549
+ var version = "1.53.1";
13550
13550
  var PACKAGE = {
13551
13551
  version: version};
13552
13552
 
@@ -13730,6 +13730,7 @@ function injectable(source) {
13730
13730
  let waiter = undefined; // An active, waiting next() call.
13731
13731
  // A pending upstream event that couldn't be dispatched because inject() has been called before it was resolved.
13732
13732
  let pendingSourceEvent = null;
13733
+ let sourceFetchInFlight = false;
13733
13734
  let pendingInjectedEvents = [];
13734
13735
  const consumeWaiter = () => {
13735
13736
  const pending = waiter;
@@ -13738,6 +13739,7 @@ function injectable(source) {
13738
13739
  };
13739
13740
  const fetchFromSource = () => {
13740
13741
  const resolveWaiter = (propagate) => {
13742
+ sourceFetchInFlight = false;
13741
13743
  const active = consumeWaiter();
13742
13744
  if (active) {
13743
13745
  propagate(active);
@@ -13746,6 +13748,7 @@ function injectable(source) {
13746
13748
  pendingSourceEvent = propagate;
13747
13749
  }
13748
13750
  };
13751
+ sourceFetchInFlight = true;
13749
13752
  const nextFromSource = source.next();
13750
13753
  nextFromSource.then((value) => {
13751
13754
  sourceIsDone = value.done == true;
@@ -13772,7 +13775,9 @@ function injectable(source) {
13772
13775
  }
13773
13776
  // Nothing pending? Fetch from source
13774
13777
  waiter = { resolve, reject };
13775
- return fetchFromSource();
13778
+ if (!sourceFetchInFlight) {
13779
+ fetchFromSource();
13780
+ }
13776
13781
  });
13777
13782
  },
13778
13783
  inject: (event) => {