@vitrinka/web 0.3.2 → 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,56 @@
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
+
25
+ ## 0.3.3
26
+
27
+ - **The other tabs leave the recording at the Stop, not when the save
28
+ ends.** 0.3.2 told them only once the stopping tab had drained its
29
+ queue and the server had closed the session, so for as long as that
30
+ took (seconds on a busy page) their pills still said rec with a running
31
+ clock, and their lanes kept capturing. The stopping tab now writes the
32
+ shared record as paused, with its clock frozen at the Stop, and marked
33
+ `stopping`. The other tabs stop capturing and painting rec within
34
+ milliseconds, and turn idle when the save ends. Its own tail still
35
+ lands. A stop that keeps the session (server unreachable) hands it back
36
+ to them as it is. Pause and resume are refused on a session another tab
37
+ is stopping. That tab renews its mark every 20 s while its Stop is out,
38
+ and a mark left by a tab closed mid-stop expires after 90 s into an
39
+ ordinary pause.
40
+ - **"Open board" appears once the board exists.** The server builds a
41
+ session's board after the stop, rendering stills first (30–60 s), so
42
+ neither the create nor the done answer carried a link. The pill said
43
+ "Saved · in Recents" (or "Sent · in Recents" for a bug report) and
44
+ never offered the board. The recorder also read only `board.url`,
45
+ while the server answers `boardUrl`. Both are read now. A stop or
46
+ report saved before its board exists reads the session every 1.5 s, for
47
+ up to 10 minutes (the extension's numbers), until the server names the
48
+ board. The link then lands on the recent, and the Saved / Sent face
49
+ turns into "Open board". A `HudController` host may return the saved
50
+ `sessionId` from `stop()` / `report()` (`HudSaved`) to get the same.
51
+ Recents opened after a reload pick up the wait for a board still being
52
+ projected, and `window.__vitrinkaRecorder.stop()` reads `boardUrl` too.
53
+
3
54
  ## 0.3.2
4
55
 
5
56
  - **A Stop in one tab ends the recording in every tab.** A second tab of
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
package/build/hud.d.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  * defining `globalThis.VitrinkaHud.mount`.
6
6
  */
7
7
  export { mountRecorderHud, type MountHudOptions } from './recorder/hud/mount';
8
- export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudReport, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
8
+ export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudReport, type HudSaved, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
9
9
  export type { RecorderStorage } from './recorder/storage';