svelte-realtime 0.5.0 → 0.5.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/client.js +17 -0
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -2562,6 +2562,23 @@ function _createStream(path, options, dynamicArgs, initialSchemaVersion) {
|
|
|
2562
2562
|
_history = [];
|
|
2563
2563
|
_historyIndex = -1;
|
|
2564
2564
|
_reconnectAttempts = 0;
|
|
2565
|
+
// Reset session-resume cursors. Cleanup means the stream is being
|
|
2566
|
+
// abandoned (last subscriber gone, deferred-cleanup microtask fired);
|
|
2567
|
+
// the next subscribe must start fresh, not falsely resume from
|
|
2568
|
+
// whatever seq / version / cursor the prior session left behind.
|
|
2569
|
+
// Without these resets, an unmount/remount cycle (e.g. browser back
|
|
2570
|
+
// then forward) sends a stale `seq` to the server, the server
|
|
2571
|
+
// responds with a since-seq delta (often empty), and the client's
|
|
2572
|
+
// reset `currentValue = undefined` never gets repopulated -- the
|
|
2573
|
+
// store stays undefined and any `{#if $store === undefined}` spinner
|
|
2574
|
+
// hangs forever. In-session WS reconnects do NOT go through cleanup,
|
|
2575
|
+
// so the replay-buffer gap-fill optimization is preserved for those.
|
|
2576
|
+
_lastSeq = null;
|
|
2577
|
+
_lastVersion = undefined;
|
|
2578
|
+
_schemaVersion = initialSchemaVersion;
|
|
2579
|
+
_cursor = null;
|
|
2580
|
+
_hasMore = false;
|
|
2581
|
+
_loadingMore = false;
|
|
2565
2582
|
_devtoolsStream(path, null, 0, merge);
|
|
2566
2583
|
}
|
|
2567
2584
|
|