@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.
package/dist/bundle.cjs CHANGED
@@ -10655,7 +10655,7 @@ function requireDist () {
10655
10655
 
10656
10656
  var distExports = requireDist();
10657
10657
 
10658
- var version = "1.53.0";
10658
+ var version = "1.53.1";
10659
10659
  var PACKAGE = {
10660
10660
  version: version};
10661
10661
 
@@ -10839,6 +10839,7 @@ function injectable(source) {
10839
10839
  let waiter = undefined; // An active, waiting next() call.
10840
10840
  // A pending upstream event that couldn't be dispatched because inject() has been called before it was resolved.
10841
10841
  let pendingSourceEvent = null;
10842
+ let sourceFetchInFlight = false;
10842
10843
  let pendingInjectedEvents = [];
10843
10844
  const consumeWaiter = () => {
10844
10845
  const pending = waiter;
@@ -10847,6 +10848,7 @@ function injectable(source) {
10847
10848
  };
10848
10849
  const fetchFromSource = () => {
10849
10850
  const resolveWaiter = (propagate) => {
10851
+ sourceFetchInFlight = false;
10850
10852
  const active = consumeWaiter();
10851
10853
  if (active) {
10852
10854
  propagate(active);
@@ -10855,6 +10857,7 @@ function injectable(source) {
10855
10857
  pendingSourceEvent = propagate;
10856
10858
  }
10857
10859
  };
10860
+ sourceFetchInFlight = true;
10858
10861
  const nextFromSource = source.next();
10859
10862
  nextFromSource.then((value) => {
10860
10863
  sourceIsDone = value.done == true;
@@ -10881,7 +10884,9 @@ function injectable(source) {
10881
10884
  }
10882
10885
  // Nothing pending? Fetch from source
10883
10886
  waiter = { resolve, reject };
10884
- return fetchFromSource();
10887
+ if (!sourceFetchInFlight) {
10888
+ fetchFromSource();
10889
+ }
10885
10890
  });
10886
10891
  },
10887
10892
  inject: (event) => {