@secondlayer/sdk 6.40.0 → 6.40.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/index.js CHANGED
@@ -655,7 +655,8 @@ async function consumeStreamsEvents(opts) {
655
655
  const emptyBackoffMs = opts.emptyBackoffMs ?? 500;
656
656
  const maxPages = opts.maxPages ?? Number.POSITIVE_INFINITY;
657
657
  const maxEmptyPolls = opts.maxEmptyPolls ?? Number.POSITIVE_INFINITY;
658
- let cursor = opts.fromCursor ?? await opts.sink?.loadCursor() ?? null;
658
+ const committedCursor = await opts.sink?.loadCursor() ?? null;
659
+ let cursor = opts.fromCursor ?? committedCursor;
659
660
  const handledReorgs = new Set;
660
661
  let pages = 0;
661
662
  let emptyPolls = 0;
@@ -820,7 +821,8 @@ async function consumeIndexFeed(opts) {
820
821
  const emptyBackoffMs = opts.emptyBackoffMs ?? 500;
821
822
  const maxPages = opts.maxPages ?? Number.POSITIVE_INFINITY;
822
823
  const maxEmptyPolls = opts.maxEmptyPolls ?? Number.POSITIVE_INFINITY;
823
- let cursor = opts.fromCursor ?? await opts.sink?.loadCursor() ?? null;
824
+ const committedCursor = await opts.sink?.loadCursor() ?? null;
825
+ let cursor = opts.fromCursor ?? committedCursor;
824
826
  const handledReorgs = new Set;
825
827
  let pages = 0;
826
828
  let emptyPolls = 0;
@@ -2875,5 +2877,5 @@ export {
2875
2877
  ApiError
2876
2878
  };
2877
2879
 
2878
- //# debugId=0D258137688545B064756E2164756E21
2880
+ //# debugId=E4A30787B92D2A4C64756E2164756E21
2879
2881
  //# sourceMappingURL=index.js.map