@ai4b-team/fsaos-gateway-sdk 3.2.1 → 3.3.0

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
@@ -2475,6 +2475,16 @@ function useInfiniteChannelMessages(options) {
2475
2475
  qc.invalidateQueries({ queryKey: stableKey });
2476
2476
  return;
2477
2477
  }
2478
+ if (newPage.messages.length > 0) {
2479
+ const minNewSeq = Math.min(...newPage.messages.map((m) => m.seq));
2480
+ if (minNewSeq > maxSeq + 1) {
2481
+ console.warn(
2482
+ `[useInfiniteChannelMessages] sequence gap detected: maxSeq=${maxSeq}, minNewSeq=${minNewSeq}. Triggering full refetch.`
2483
+ );
2484
+ qc.invalidateQueries({ queryKey: stableKey });
2485
+ return;
2486
+ }
2487
+ }
2478
2488
  qc.setQueryData(stableKey, (old) => {
2479
2489
  if (!old) return old;
2480
2490
  const pages = [...old.pages];