@scalebun/web 1.2.2 → 1.2.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.
Files changed (117) hide show
  1. package/README.md +0 -2
  2. package/dist/bootstrap/SDKBootstrapper.d.ts.map +1 -1
  3. package/dist/bootstrap/SDKBootstrapper.js +37 -1
  4. package/dist/bootstrap/SDKBootstrapper.js.map +1 -1
  5. package/dist/core/prune.d.ts +28 -4
  6. package/dist/core/prune.d.ts.map +1 -1
  7. package/dist/core/prune.js +92 -11
  8. package/dist/core/prune.js.map +1 -1
  9. package/dist/features/bugreport/BugReportFeature.d.ts +3 -2
  10. package/dist/features/bugreport/BugReportFeature.d.ts.map +1 -1
  11. package/dist/features/bugreport/BugReportFeature.js +2 -1
  12. package/dist/features/bugreport/BugReportFeature.js.map +1 -1
  13. package/dist/features/bugreport/widget.d.ts +21 -2
  14. package/dist/features/bugreport/widget.d.ts.map +1 -1
  15. package/dist/features/bugreport/widget.js +37 -4
  16. package/dist/features/bugreport/widget.js.map +1 -1
  17. package/dist/features/coach/overlay.d.ts.map +1 -1
  18. package/dist/features/coach/overlay.js +26 -5
  19. package/dist/features/coach/overlay.js.map +1 -1
  20. package/dist/features/engage/EngageFeature.d.ts +7 -1
  21. package/dist/features/engage/EngageFeature.d.ts.map +1 -1
  22. package/dist/features/engage/EngageFeature.js +32 -10
  23. package/dist/features/engage/EngageFeature.js.map +1 -1
  24. package/dist/features/engage/normalize.d.ts.map +1 -1
  25. package/dist/features/engage/normalize.js +7 -0
  26. package/dist/features/engage/normalize.js.map +1 -1
  27. package/dist/features/engage/runtime.d.ts +11 -0
  28. package/dist/features/engage/runtime.d.ts.map +1 -1
  29. package/dist/features/engage/runtime.js +25 -10
  30. package/dist/features/engage/runtime.js.map +1 -1
  31. package/dist/features/engage/throttle.d.ts +16 -6
  32. package/dist/features/engage/throttle.d.ts.map +1 -1
  33. package/dist/features/engage/throttle.js +96 -6
  34. package/dist/features/engage/throttle.js.map +1 -1
  35. package/dist/features/engage/types.d.ts +6 -0
  36. package/dist/features/engage/types.d.ts.map +1 -1
  37. package/dist/features/engage/types.js.map +1 -1
  38. package/dist/features/inapp/InApp2Feature.d.ts.map +1 -1
  39. package/dist/features/inapp/InApp2Feature.js +1 -0
  40. package/dist/features/inapp/InApp2Feature.js.map +1 -1
  41. package/dist/features/inapp/blocks/styles.d.ts +1 -1
  42. package/dist/features/inapp/blocks/styles.d.ts.map +1 -1
  43. package/dist/features/inapp/blocks/styles.js +30 -3
  44. package/dist/features/inapp/blocks/styles.js.map +1 -1
  45. package/dist/features/inapp/center/panel.d.ts +1 -1
  46. package/dist/features/inapp/center/panel.d.ts.map +1 -1
  47. package/dist/features/inapp/center/panel.js +40 -6
  48. package/dist/features/inapp/center/panel.js.map +1 -1
  49. package/dist/features/inapp/core/engine.d.ts +2 -0
  50. package/dist/features/inapp/core/engine.d.ts.map +1 -1
  51. package/dist/features/inapp/core/engine.js +1 -1
  52. package/dist/features/inapp/core/engine.js.map +1 -1
  53. package/dist/features/inapp/core/host.d.ts.map +1 -1
  54. package/dist/features/inapp/core/host.js +5 -1
  55. package/dist/features/inapp/core/host.js.map +1 -1
  56. package/dist/features/inapp/core/targeting.d.ts +29 -2
  57. package/dist/features/inapp/core/targeting.d.ts.map +1 -1
  58. package/dist/features/inapp/core/targeting.js +78 -4
  59. package/dist/features/inapp/core/targeting.js.map +1 -1
  60. package/dist/features/inapp/surfaces/coachmark.d.ts.map +1 -1
  61. package/dist/features/inapp/surfaces/coachmark.js +5 -2
  62. package/dist/features/inapp/surfaces/coachmark.js.map +1 -1
  63. package/dist/features/inapp/surfaces/hotspot.d.ts.map +1 -1
  64. package/dist/features/inapp/surfaces/hotspot.js +5 -2
  65. package/dist/features/inapp/surfaces/hotspot.js.map +1 -1
  66. package/dist/features/inapp/surfaces/inline.d.ts.map +1 -1
  67. package/dist/features/inapp/surfaces/inline.js +7 -1
  68. package/dist/features/inapp/surfaces/inline.js.map +1 -1
  69. package/dist/features/inapp/surfaces/popover.d.ts.map +1 -1
  70. package/dist/features/inapp/surfaces/popover.js +5 -2
  71. package/dist/features/inapp/surfaces/popover.js.map +1 -1
  72. package/dist/features/inapp/surfaces/styles.d.ts +1 -1
  73. package/dist/features/inapp/surfaces/styles.d.ts.map +1 -1
  74. package/dist/features/inapp/surfaces/styles.js +60 -11
  75. package/dist/features/inapp/surfaces/styles.js.map +1 -1
  76. package/dist/features/inapp/surfaces/toolbar.d.ts.map +1 -1
  77. package/dist/features/inapp/surfaces/toolbar.js +5 -2
  78. package/dist/features/inapp/surfaces/toolbar.js.map +1 -1
  79. package/dist/features/inapp/surfaces/tour.d.ts.map +1 -1
  80. package/dist/features/inapp/surfaces/tour.js +5 -2
  81. package/dist/features/inapp/surfaces/tour.js.map +1 -1
  82. package/dist/features/inapp/types.d.ts +2 -0
  83. package/dist/features/inapp/types.d.ts.map +1 -1
  84. package/dist/features/journey/InteractionTracker.d.ts.map +1 -1
  85. package/dist/features/journey/InteractionTracker.js +137 -0
  86. package/dist/features/journey/InteractionTracker.js.map +1 -1
  87. package/dist/features/manifest.d.ts +21 -0
  88. package/dist/features/manifest.d.ts.map +1 -1
  89. package/dist/features/manifest.js +27 -10
  90. package/dist/features/manifest.js.map +1 -1
  91. package/dist/features/replay/ReplayFeature.d.ts +20 -0
  92. package/dist/features/replay/ReplayFeature.d.ts.map +1 -1
  93. package/dist/features/replay/ReplayFeature.js +155 -5
  94. package/dist/features/replay/ReplayFeature.js.map +1 -1
  95. package/dist/features/replay/lifecycle/recorder.d.ts +21 -1
  96. package/dist/features/replay/lifecycle/recorder.d.ts.map +1 -1
  97. package/dist/features/replay/lifecycle/recorder.js +20 -4
  98. package/dist/features/replay/lifecycle/recorder.js.map +1 -1
  99. package/dist/features/session/sessionStore.d.ts +17 -1
  100. package/dist/features/session/sessionStore.d.ts.map +1 -1
  101. package/dist/features/session/sessionStore.js +17 -1
  102. package/dist/features/session/sessionStore.js.map +1 -1
  103. package/dist/pipeline/pipeline.d.ts +82 -0
  104. package/dist/pipeline/pipeline.d.ts.map +1 -1
  105. package/dist/pipeline/pipeline.js +307 -14
  106. package/dist/pipeline/pipeline.js.map +1 -1
  107. package/dist/public/ScaleBunFacade.d.ts +31 -0
  108. package/dist/public/ScaleBunFacade.d.ts.map +1 -1
  109. package/dist/public/ScaleBunFacade.js +43 -7
  110. package/dist/public/ScaleBunFacade.js.map +1 -1
  111. package/dist/scalebun.min.js +147 -65
  112. package/dist/scalebun.min.js.map +4 -4
  113. package/dist/transport/httpClient.d.ts +56 -2
  114. package/dist/transport/httpClient.d.ts.map +1 -1
  115. package/dist/transport/httpClient.js +81 -5
  116. package/dist/transport/httpClient.js.map +1 -1
  117. package/package.json +9 -3
@@ -12,6 +12,15 @@ import { capBytes, freshOnly } from '../core/prune.js';
12
12
  // annotation pins this to the contract: a protocol SCHEMA_VERSION bump fails the SDK build. The
13
13
  // `import(...)` is type-only (erased), so it adds zero runtime weight.
14
14
  const SCHEMA_VERSION = 1;
15
+ /** Replay-frame discriminators, shared by the queue-eviction and byte-cap policies so the two cannot
16
+ * disagree about what a keyframe is. Structural checks — the frame types live in the lazy replay
17
+ * chunk and must not be imported into the eager core. */
18
+ const isFrame = (it) => it.kind === 'frame';
19
+ const isKeyframe = (it) => it.frameType === 'keyframe';
20
+ const isDeltaFrame = (it) => isFrame(it) && !isKeyframe(it);
21
+ /** Re-arm attempts for a failed session-create. Small on purpose: this covers a transient 5xx or a
22
+ * boot while offline, not a server that is refusing on principle. */
23
+ const MAX_SESSION_RETRIES = 3;
15
24
  export class Pipeline {
16
25
  constructor(config, session, transport) {
17
26
  this.config = config;
@@ -20,6 +29,23 @@ export class Pipeline {
20
29
  this.queue = [];
21
30
  this.timer = null;
22
31
  this.droppedCount = 0;
32
+ /**
33
+ * P6 — the egress ledger. `pending` and `dropped` alone could not answer the question the
34
+ * reliability work kept running into: recovery demonstrably WORKS (frames arrive with a capture-to-
35
+ * storage gap of up to 12.8 hours, which only a durable queue draining on a later visit produces)
36
+ * and its contribution was completely uncountable, so it could never be separated from ordinary
37
+ * delivery or defended when someone asked whether it was worth its bytes.
38
+ *
39
+ * `expired` is split out of `dropped` deliberately. Age-pruning a queue the app sat on for days is
40
+ * correct behaviour; evicting a live item because the queue overflowed is data loss. Counting both
41
+ * as "dropped" made a healthy reload look like a leak, which is how a real signal gets ignored.
42
+ */
43
+ this.queuedCount = 0;
44
+ this.attemptedCount = 0;
45
+ this.retriedCount = 0;
46
+ this.recoveredCount = 0;
47
+ this.expiredCount = 0;
48
+ this.ackedCount = 0;
23
49
  this.started = false;
24
50
  // After discard() (consent denied) no-op ALL egress + persistence, so a racing fire-and-forget
25
51
  // save() / pagehide can't re-persist denied data (drained on the next load). Reset on start().
@@ -32,6 +58,16 @@ export class Pipeline {
32
58
  * from each splicing a different batch out of the queue. Parity with the in-app transport and the
33
59
  * RN EventTracker, which both guard; the session lane was the gap. */
34
60
  this.flushing = false;
61
+ /** Resolves once the server has a session row for these items to attach to. Every flush awaits it
62
+ * — see start(). Pre-resolved so a flush before start() (or after stop()) is not deadlocked. */
63
+ this.sessionStarted = Promise.resolve();
64
+ /** True once session-create has actually succeeded. See `armSession()`. */
65
+ this.sessionOk = false;
66
+ /** Re-arm attempts spent. Bounded so a permanently-refusing server costs a few extra requests
67
+ * rather than one per flush for the life of the page. */
68
+ this.sessionRetries = 0;
69
+ /** A keyframe wanted the fast path while a batch was in flight — drain again on completion. */
70
+ this.keyframePending = false;
35
71
  /** The batch currently being sent. It is NOT in `queue`, so persistence must still see it — if the
36
72
  * page dies mid-send, that fetch is cancelled and the re-queue never runs. */
37
73
  this.inFlight = [];
@@ -51,6 +87,19 @@ export class Pipeline {
51
87
  return;
52
88
  this.started = true;
53
89
  this.dead = false; // re-grant after a prior discard() revives egress
90
+ /**
91
+ * Session-start is issued FIRST, and synchronously — before this method awaits anything.
92
+ *
93
+ * It used to sit after the IndexedDB drain below. That drain is an await, so a keyframe emitted
94
+ * during it fast-flushed against a `sessionStarted` still holding the pre-resolved default,
95
+ * and went out before the session existed: measured +7252ms batch, +7260ms session-create, and
96
+ * the server answers 200 while dropping every item of an unknown session. Assigning the gate
97
+ * here means there is no window in which a flush can outrun the row it needs.
98
+ *
99
+ * Ordering is also just correct on its own terms: nothing the drain recovers can be ingested
100
+ * until the session exists either.
101
+ */
102
+ this.armSession();
54
103
  // Drain anything persisted from a previous page load (at-least-once across reloads), dropping
55
104
  // items older than the max age so a reload doesn't replay data the app sat on for days.
56
105
  try {
@@ -60,8 +109,11 @@ export class Pipeline {
60
109
  const sid = typeof raw[0] === 'string' ? raw[0] : '';
61
110
  const prev = (sid ? raw[1] : raw) ?? [];
62
111
  const fresh = freshOnly(prev, (it) => it.timestamp, now());
63
- this.droppedCount += prev.length - fresh.length;
112
+ this.expiredCount += prev.length - fresh.length; // age-pruned, not lost — see the ledger note
64
113
  if (fresh.length) {
114
+ // Recovered = survived a page load. Counted here rather than on delivery so the number means
115
+ // "the durable queue did its job", independent of whether the network is up right now.
116
+ this.recoveredCount += fresh.length;
65
117
  if (sid && sid !== this.session.sessionId)
66
118
  void this.drainOrphans(sid, fresh);
67
119
  else
@@ -71,15 +123,41 @@ export class Pipeline {
71
123
  catch {
72
124
  /* ignore */
73
125
  }
74
- void this.transport.startSession({
126
+ this.timer = setInterval(() => this.autoFlush(), this.config.flushIntervalMs);
127
+ this.installLifecycleFlush();
128
+ // A keyframe captured before start() could not fast-flush (no gate yet), so do it here — the
129
+ // gate now exists and this is the first moment it is safe. Without this, the session that most
130
+ // needs the fast path (the recorder beat the pipeline) is the one that waits for the timer.
131
+ if (this.queue.some(isKeyframe))
132
+ void this.flush();
133
+ }
134
+ /**
135
+ * Issue session-create and hold the gate on it.
136
+ *
137
+ * Separate from `start()` because it must be RE-ISSUABLE. It ran exactly once, with its rejection
138
+ * swallowed by a bare `.catch(() => {})`, so a session-create that failed — offline at boot, a 5xx,
139
+ * a CORS misconfiguration — left a gate that resolved happily onto a session row the server did not
140
+ * have. Every subsequent batch was then rejected as `unknown_session`, which is retryable, so the
141
+ * pipeline retried the same items against a row that nothing was ever going to create. The one
142
+ * request that could have fixed it was the one request never sent again.
143
+ *
144
+ * `sessionOk` is what flush() reads to decide whether re-arming is worth a try; it is false both
145
+ * before the first attempt resolves and after a failed one.
146
+ */
147
+ armSession() {
148
+ this.sessionOk = false;
149
+ this.sessionStarted = this.transport
150
+ .startSession({
75
151
  sessionId: this.session.sessionId,
76
152
  client: this.session.client(),
77
153
  device: this.session.device(),
78
154
  app: this.session.app(),
79
155
  context: this.session.context(),
80
- });
81
- this.timer = setInterval(() => this.autoFlush(), this.config.flushIntervalMs);
82
- this.installLifecycleFlush();
156
+ })
157
+ .then(() => {
158
+ this.sessionOk = true;
159
+ })
160
+ .catch(() => { });
83
161
  }
84
162
  emit(item) {
85
163
  // Consent gate (belt-and-suspenders for manual facade emits): drop, don't buffer, while gated.
@@ -88,10 +166,92 @@ export class Pipeline {
88
166
  return;
89
167
  }
90
168
  if (this.queue.length >= this.config.maxQueueSize) {
91
- this.queue.shift(); // drop oldest
169
+ /**
170
+ * Evict the oldest DELTA frame, not blindly the oldest item.
171
+ *
172
+ * Early in a session the head of this queue is the replay KEYFRAME, and it is the one item
173
+ * whose loss costs more than itself: every delta behind it reconstructs against it, so
174
+ * dropping it turns the whole segment into unplayable `orphaned` frames. A delta is the
175
+ * cheapest thing here — the player interpolates across a gap. Falls back to the old
176
+ * drop-oldest when the queue holds no delta (all events, or a lone keyframe).
177
+ */
178
+ const i = this.queue.findIndex(isDeltaFrame);
179
+ this.queue.splice(i >= 0 ? i : 0, 1);
92
180
  this.droppedCount++;
93
181
  }
182
+ this.queuedCount++;
94
183
  this.queue.push(item);
184
+ /**
185
+ * A KEYFRAME does not wait for the next tick.
186
+ *
187
+ * MEASURED on a live app: time from navigation to the first frame batch leaving the browser was
188
+ * 5920 / 5959 / 6007 ms across ten sessions — pinned to `flushIntervalMs` (5000), not to how
189
+ * long the snapshot took. The recorder had the keyframe within a few hundred ms; it then sat in
190
+ * this queue waiting for a timer. Any visitor who left inside that window lost the ENTIRE
191
+ * session's replay, because the keyframe is what makes every delta behind it playable.
192
+ *
193
+ * That is the shape of the production defect: of the sessions that arrived complete in every
194
+ * other lane with zero frames stored, 44% lasted 3-10s and 18% lasted 1-3s — i.e. they ended
195
+ * before the first flush tick. `pagehide` is the backstop, but it is not guaranteed to run (a
196
+ * backgrounded tab killed by mobile Safari never fires it), so relying on it is what left a
197
+ * measured 27% of sessions with no replay.
198
+ *
199
+ * Only keyframes. Deltas are small, frequent, and worthless without their base, so they keep
200
+ * batching normally — this costs one extra request per keyframe (~30s apart), not one per frame.
201
+ * `flush()` no-ops while a batch is already in flight, so a keyframe arriving mid-flush is
202
+ * picked up by the next drain rather than racing it.
203
+ *
204
+ * `this.started` is load-bearing, not defensive. Features install and emit before start() has
205
+ * run, and a fast-flush from there would race the very gate that protects it: measured, the
206
+ * keyframe batch left at +1768ms while session-create was issued at +1766ms and only answered at
207
+ * +1792ms — the flush had already begun against the pre-resolved default gate and the frames
208
+ * were dropped with a 200. start() sets `started` and assigns the gate in one synchronous block,
209
+ * so checking it here makes the ordering unconditional. A keyframe that arrives before start()
210
+ * is flushed by start() itself, once the gate exists.
211
+ */
212
+ if (this.started && isKeyframe(item)) {
213
+ // A flush already in flight would make flush() a no-op here, and the "next drain" is the 5s
214
+ // timer — which a bouncing visitor never reaches. Measured: the keyframe arrived while the
215
+ // first batch was mid-send, the fast path was skipped, and a 3s session stored nothing.
216
+ if (this.flushing)
217
+ this.keyframePending = true;
218
+ else
219
+ void this.flush();
220
+ }
221
+ }
222
+ /**
223
+ * Say that data was thrown away, on the one lane proven to work.
224
+ *
225
+ * A permanent rejection is real, unrecoverable data loss — an 8 MB keyframe or a closed entitlement
226
+ * will be refused identically forever, so the only correct action is to drop it. Dropping it
227
+ * SILENTLY is what made the `missing` replay bucket undiagnosable: replay produced nothing, and
228
+ * neither the client nor the server had anything to say about why. `dropped` alone cannot carry it
229
+ * either, since it already means "queue overflow".
230
+ *
231
+ * Same event name as the React Native SDK (`sdk_replay_capture_failed`), with platform-specific
232
+ * `reason` values, so one dashboard breakdown reads both platforms without a concept-map alias.
233
+ *
234
+ * Emitted through `emit()` on purpose: it inherits the durable queue, the consent gate and the
235
+ * batching that every other item gets. Latched to once per kind — see `reported`.
236
+ */
237
+ reportDrop(kind, reason) {
238
+ if (!kind)
239
+ return;
240
+ this.reported ?? (this.reported = new Set());
241
+ if (this.reported.has(kind))
242
+ return;
243
+ this.reported.add(kind);
244
+ this.emit({
245
+ kind: 'event',
246
+ name: 'sdk_replay_capture_failed',
247
+ timestamp: now(),
248
+ // `props`, NOT `properties`. The wire field is `props` — `mappers.ts` reads `data: it.props`,
249
+ // and `EventItemSchema` is `.passthrough()`, so an unknown key is carried to the mapper and
250
+ // then silently dropped with no error anywhere. Sending `properties` cost this event its
251
+ // entire payload: every `sdk_replay_capture_failed` landed with no stage, lane or reason —
252
+ // the one field the whole mechanism exists to deliver. `ack.test.ts` pins the key.
253
+ props: { stage: 'ingest-rejected', lane: kind, reason: reason ?? 'unknown' },
254
+ });
95
255
  }
96
256
  /** Persist the pending queue to IDB, trimmed to the byte budget (replay frames shed first so a
97
257
  * few large keyframes can't blow the IndexedDB quota). */
@@ -106,7 +266,7 @@ export class Pipeline {
106
266
  // truncating the first replay and interleaving foreign seq numbers into the second.
107
267
  void this.buffer.save([
108
268
  this.session.sessionId,
109
- capBytes(pending, (it) => it.kind === 'frame'),
269
+ capBytes(pending, isFrame, isKeyframe),
110
270
  ]);
111
271
  }
112
272
  /** Auto (timer/reconnect-driven) flush: skip while offline or inside the backoff window so a
@@ -129,13 +289,110 @@ export class Pipeline {
129
289
  const batch = this.queue.splice(0, this.config.maxBatchSize);
130
290
  this.inFlight = batch; // keep it reachable by persistQueue() until it's acknowledged
131
291
  try {
132
- const ok = await this.transport.sendBatch(this.buildEnvelope(batch), opts);
133
- if (ok) {
134
- this.backoff.reset();
292
+ // The server drops items for a session it has no row for, and answers 200 while doing it —
293
+ // so this await is what makes at-least-once actually hold for the first batch of a session.
294
+ await this.sessionStarted;
295
+ /**
296
+ * Re-arm a session that never got created, before spending the batch against a row the server
297
+ * does not have. Bounded — see `sessionRetries`.
298
+ *
299
+ * `this.started` is load-bearing. Before start() (and after stop()) `sessionStarted` is the
300
+ * pre-resolved default and `sessionOk` is false — which is not a failed session-create, it is
301
+ * "there is no session lane yet". Without this guard a flush from either state issues a
302
+ * session-create the caller never asked for, which is both wrong and exactly what the
303
+ * pre-resolved default exists to avoid.
304
+ */
305
+ if (this.started && !this.sessionOk && this.sessionRetries < MAX_SESSION_RETRIES) {
306
+ this.sessionRetries++;
307
+ this.armSession();
308
+ await this.sessionStarted;
309
+ }
310
+ this.attemptedCount++;
311
+ const ack = await this.transport.sendBatch(this.buildEnvelope(batch), opts);
312
+ if (ack) {
135
313
  this.inFlight = [];
314
+ // ACKed = the server accepted these items. Set here and corrected below for the per-kind
315
+ // rejections, so `acked` counts what was STORED rather than what was merely 2xx'd — which is
316
+ // the distinction the whole per-kind receipt exists to draw.
317
+ this.ackedCount += batch.length;
318
+ /**
319
+ * A 2xx is NOT proof the items were stored.
320
+ *
321
+ * The backend fans the envelope out by item kind and catches each kind's failures so one bad
322
+ * kind cannot fail the whole batch — then answers 200 regardless. The per-kind verdict in
323
+ * `results` is the real receipt, and until this read it, a rejected `frame` group was cleared
324
+ * from the queue and from IndexedDB while the `event`/`performance` groups beside it landed:
325
+ * the exact fingerprint of the `missing` replay bucket.
326
+ *
327
+ * `retry` distinguishes the two rejections that need opposite handling. An unknown session
328
+ * becomes known as soon as `startSession` lands, so those items go back. An oversized payload
329
+ * or a closed entitlement will be refused identically forever, so re-queueing it would loop
330
+ * on the same bytes until the queue cap evicted something that WOULD have been accepted —
331
+ * those are dropped and counted, so `dropped` stops meaning only "queue overflow".
332
+ *
333
+ * A kind absent from the map was stored. That is what makes this safe against a backend that
334
+ * predates the field: no entries, nothing re-queued, behaviour identical to before.
335
+ */
336
+ const back = [];
337
+ let dropped = 0;
338
+ for (const it of batch) {
339
+ const kind = it.kind ?? '';
340
+ const r = ack[kind];
341
+ if (!r || r.ok)
342
+ continue;
343
+ this.ackedCount--; // provisionally counted above; this kind was NOT stored
344
+ if (r.retry) {
345
+ back.push(it);
346
+ this.retriedCount++;
347
+ }
348
+ else {
349
+ dropped++;
350
+ this.droppedCount++;
351
+ this.reportDrop(kind, r.reason);
352
+ }
353
+ }
354
+ /**
355
+ * HOW A RETRYABLE REJECTION IS RE-QUEUED — and why it is not simply `unshift`.
356
+ *
357
+ * `unshift` + an unconditional `backoff.reset()` was an infinite loop that starved every
358
+ * other lane. A session whose row was never created rejects EVERY kind as retryable, so
359
+ * `back` came back the full width of the batch, went to the HEAD, and `flush()` — which
360
+ * takes `splice(0, maxBatchSize)` — selected exactly the same items on the next tick. The
361
+ * backoff had just been reset because the response was a 2xx, so there was no widening
362
+ * window either: the same 50 items re-POSTed every flush interval, forever, while items
363
+ * emitted behind them sat at the tail and were eventually evicted by the queue cap.
364
+ *
365
+ * So the branch turns on whether ANYTHING landed:
366
+ * - Something landed → the server is working and this is an ordinary partial retry. Reset
367
+ * the window and put the items back at the head, where they keep their place in line.
368
+ * - Nothing landed → a 2xx that stored none of the batch is a FAILURE for our purposes,
369
+ * whatever the status code said. Widen the retry window like any other failure, and
370
+ * re-queue at the TAIL so a lane that cannot land stops holding the head hostage. The
371
+ * items are not lost — they are behind the other lanes instead of in front of them.
372
+ *
373
+ * Frame order survives the tail move: the backend orders frames by `sequenceNumber`, not by
374
+ * arrival, and these items keep their relative order among themselves.
375
+ */
376
+ if (back.length) {
377
+ if (batch.length - back.length - dropped === 0) {
378
+ this.backoff.fail(now());
379
+ this.queue.push(...back);
380
+ }
381
+ else {
382
+ this.backoff.reset();
383
+ this.queue.unshift(...back);
384
+ }
385
+ this.persistQueue();
386
+ }
387
+ else {
388
+ this.backoff.reset();
389
+ }
136
390
  }
137
391
  else {
392
+ // The request itself failed (offline, 5xx, abort). Nothing was stored, so nothing is ACKed;
393
+ // the whole batch goes back and counts as retried.
138
394
  this.backoff.fail(now());
395
+ this.retriedCount += batch.length;
139
396
  this.queue.unshift(...batch);
140
397
  this.inFlight = []; // back in `queue` — persistQueue() sees it there now
141
398
  this.persistQueue();
@@ -145,6 +402,7 @@ export class Pipeline {
145
402
  // A throwing transport must not swallow the batch (and must not throw into the host: every
146
403
  // caller invokes flush() as `void flush()`, so a rejection would surface as an unhandled one).
147
404
  this.backoff.fail(now());
405
+ this.retriedCount += batch.length;
148
406
  this.queue.unshift(...batch);
149
407
  this.inFlight = [];
150
408
  this.persistQueue();
@@ -152,6 +410,12 @@ export class Pipeline {
152
410
  finally {
153
411
  this.flushing = false;
154
412
  }
413
+ // A keyframe that asked for the fast path mid-flush gets it now, rather than waiting out the
414
+ // flush interval. Cleared before recursing, so this drains once per keyframe, not in a loop.
415
+ if (this.keyframePending) {
416
+ this.keyframePending = false;
417
+ void this.flush(opts);
418
+ }
155
419
  }
156
420
  /**
157
421
  * Ship a queue recovered from a PREVIOUS session under that session's own id.
@@ -182,15 +446,26 @@ export class Pipeline {
182
446
  void this.drainOrphans(sid, [item]);
183
447
  }
184
448
  async drainOrphans(sid, items) {
185
- let ok = false;
449
+ let ack = null;
186
450
  try {
187
- ok = await this.transport.sendBatch({ ...this.buildEnvelope(items), sessionId: sid });
451
+ ack = await this.transport.sendBatch({ ...this.buildEnvelope(items), sessionId: sid });
188
452
  }
189
453
  catch {
190
454
  /* treated as a failure */
191
455
  }
192
- if (!ok)
193
- void this.buffer.save([sid, items]);
456
+ /**
457
+ * Re-persist unless the server took it, applying the SAME per-kind rule as flush(): a permanent
458
+ * rejection is not worth another attempt, and re-saving it here would hold the single buffer slot
459
+ * against a payload that can never land. `null` (request failed) still re-saves everything.
460
+ */
461
+ const keep = ack
462
+ ? items.filter((it) => {
463
+ const r = ack[it.kind ?? ''];
464
+ return r && !r.ok && r.retry;
465
+ })
466
+ : items;
467
+ if (keep.length)
468
+ void this.buffer.save([sid, keep]);
194
469
  }
195
470
  buildEnvelope(items) {
196
471
  return {
@@ -280,5 +555,23 @@ export class Pipeline {
280
555
  get dropped() {
281
556
  return this.droppedCount;
282
557
  }
558
+ /**
559
+ * P6 — the full egress ledger, for `ScaleBun.egressStats()`.
560
+ *
561
+ * Exposed as one object rather than seven getters so a caller reads a CONSISTENT snapshot: the
562
+ * counters move on network callbacks, and seven separate reads could straddle a flush and produce a
563
+ * set that never actually existed.
564
+ */
565
+ get ledger() {
566
+ return {
567
+ queued: this.queuedCount,
568
+ attempted: this.attemptedCount,
569
+ retried: this.retriedCount,
570
+ recovered: this.recoveredCount,
571
+ dropped: this.droppedCount,
572
+ expired: this.expiredCount,
573
+ acked: this.ackedCount,
574
+ };
575
+ }
283
576
  }
284
577
  //# sourceMappingURL=pipeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/pipeline/pipeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEpD,qGAAqG;AACrG,mGAAmG;AACnG,gGAAgG;AAChG,uEAAuE;AACvE,MAAM,cAAc,GAA4D,CAAC,CAAC;AAElF,MAAM,OAAO,QAAQ;IAuBnB,YACmB,MAAsB,EACtB,OAAuB,EACvB,SAAqB;QAFrB,WAAM,GAAN,MAAM,CAAgB;QACtB,YAAO,GAAP,OAAO,CAAgB;QACvB,cAAS,GAAT,SAAS,CAAY;QAzBhC,UAAK,GAAW,EAAE,CAAC;QACnB,UAAK,GAA0C,IAAI,CAAC;QACpD,iBAAY,GAAG,CAAC,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QAIxB,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AAG,KAAK,CAAC;QACrB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;QACd,CAAC;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACH,IAAI,MAAM;QASR,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,KAAK,EAAE,IAAI,CAAC,UAAU;SACvB,CAAC;IACJ,CAAC;CACF"}
@@ -19,6 +19,11 @@ import type { PushEnableOptions, PushEnableStatus, PushStatus } from '../feature
19
19
  import type { PushDiagnostics } from '../features/push/diagnostics.js';
20
20
  import type { InboxController } from '../features/inbox/types.js';
21
21
  import type { TourSpec } from '../features/coach/types.js';
22
+ /**
23
+ * Why a bug-report submit produced no id. Type-only, so it costs the bundle nothing; the sentences
24
+ * these map to live in the lazily loaded widget chunk. See `reportBugDetailed`.
25
+ */
26
+ export type BugFailure = 'init' | 'off' | 'empty' | 'consent' | 'send';
22
27
  declare class ScaleBunFacade {
23
28
  private rt;
24
29
  private ready;
@@ -147,11 +152,31 @@ declare class ScaleBunFacade {
147
152
  * Dynamic-imported so a host that never places inline messages pays nothing for the registry.
148
153
  */
149
154
  registerInAppSlot(name: string, el: HTMLElement): Promise<() => void>;
155
+ /**
156
+ * The public signature is unchanged (`string | null`) because hosts call it — the reason travels
157
+ * on a separate internal path, `reportBugDetailed`, which the widget uses.
158
+ */
150
159
  reportBug(input: {
151
160
  message: string;
152
161
  title?: string;
153
162
  email?: string;
154
163
  }): Promise<string | null>;
164
+ /**
165
+ * The submit path, with WHY it failed.
166
+ *
167
+ * Six independent branches here return no id, and the widget used to render one sentence for all
168
+ * of them — "Could not send the report. Please try again." Retrying a consent block, a disabled
169
+ * feature or an uninitialised SDK can never work, so that message sent the reader in a loop and
170
+ * hid the one thing they could act on. Codes, not prose: the sentences live in the lazily loaded
171
+ * widget chunk so they cost the core bundle nothing.
172
+ */
173
+ reportBugDetailed(input: {
174
+ message: string;
175
+ title?: string;
176
+ email?: string;
177
+ }): Promise<string | {
178
+ e: BugFailure;
179
+ }>;
155
180
  /** Force an immediate flush of BOTH egress lanes (session pipeline + analytics /batch). */
156
181
  flush(): Promise<void>;
157
182
  /** The SDK's own error-pipeline health (captured / dropped / by-type / breadcrumb count). */
@@ -170,6 +195,12 @@ declare class ScaleBunFacade {
170
195
  egressStats(): {
171
196
  pending: number;
172
197
  dropped: number;
198
+ queued: number;
199
+ attempted: number;
200
+ retried: number;
201
+ recovered: number;
202
+ expired: number;
203
+ acked: number;
173
204
  };
174
205
  /** A7 — product-analytics lane observability: events pending/dropped/sampled-out, successful
175
206
  * flushes, and the active sample rate. Null when analytics isn't running. */
@@ -1 +1 @@
1
- {"version":3,"file":"ScaleBunFacade.d.ts","sourceRoot":"","sources":["../../src/public/ScaleBunFacade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAwI,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACrL,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAqC,KAAK,UAAU,EAAsB,MAAM,0BA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