@vitrinka/web 0.3.3 → 0.3.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @vitrinka/web
2
2
 
3
+ ## 0.3.4
4
+
5
+ - **Two tabs no longer collide on event sequence numbers.** Events and rrweb
6
+ chunks share an exclusive allocator using Web Locks, with an IndexedDB
7
+ transaction fallback for HTTP hosts. A separate watermark prevents pause,
8
+ policy and Stop writes from rewinding the counter. Stop settles queued
9
+ allocations before draining; failed allocations stay queued for retry.
10
+ Shared custom storage drivers implement `withLock(name, run)`.
11
+ Accepted payloads are journaled before the async lock and retain the same
12
+ identity until server acknowledgement; reloads and surviving tabs can
13
+ recover them. Pending allocation memory is bounded to 16 MiB.
14
+ - **Stop saves every open tab's tail before closing the session.** Mounted
15
+ tabs acknowledge only after their last rrweb batch and pending captures
16
+ have drained. A sibling that cannot save refuses the Stop instead of
17
+ losing its last notes. Shared drivers expose `keys()` alongside `watch()`.
18
+ A departing tab leaves an unsaved marker instead of falsely acknowledging
19
+ delivery; a surviving tab can recover a durable tail. Back-forward cache
20
+ returns restore participant registration. Every path observing Stop ships
21
+ the last DOM batch before pausing its local cache.
22
+ - The sync indicator uses the highest acknowledged seq even when an rrweb
23
+ chunk's delayed event row appears last in the upload batch.
24
+
3
25
  ## 0.3.3
4
26
 
5
27
  - **The other tabs leave the recording at the Stop, not when the save
package/README.md CHANGED
@@ -282,6 +282,24 @@ a recording joins it, and a Start, pause or Stop in one tab reaches the
282
282
  others through the driver's optional `watch(key, onChange)` (the
283
283
  `localStorage` driver implements it with the `storage` event).
284
284
 
285
+ Event and rrweb-chunk sequence numbers are allocated under a cross-tab
286
+ Web Lock, or an IndexedDB transaction on hosts without Web Locks. Stop
287
+ waits for these allocations before draining. A custom driver shared across
288
+ documents must implement `withLock(name, run)` and run the synchronous
289
+ callback exclusively across them; a document-local driver needs no lock.
290
+ Shared drivers also implement `keys()` to coordinate Stop: each mounted tab
291
+ ships its last rrweb batch and drains its captures before acknowledging.
292
+ An undelivered sibling tail refuses Stop and stays queued for retry.
293
+ Accepted captures are journaled before waiting for a lock, preserving their
294
+ timestamps and allocated seq through a reload. Other tabs can drain the same
295
+ journal safely; it is deleted after the server acknowledges the event.
296
+ Leaving a tab is not a delivery acknowledgement. A fully journaled departed
297
+ tail can be recovered by the remaining tab; a memory-only tail keeps Stop
298
+ blocked. Returning from the browser's back-forward cache re-registers the tab.
299
+ Pending allocations have a 16 MiB byte budget, 20,000-event count limit and
300
+ 200-chunk limit; overflow drops the oldest capture with a warning and health
301
+ failure, matching the queue's existing bounded retry behavior.
302
+
285
303
  ## Development
286
304
 
287
305
  ```bash