fix(replay): retry the full-snapshot heal on rotated sessions - #4590
fix(replay): retry the full-snapshot heal on rotated sessions#4590posthog[bot] wants to merge 2 commits into
Conversation
A rotated session can start with incrementals and no full snapshot, which the player cannot render. The heal path requested one snapshot per target session id and latched off, so a heal that never produced a snapshot left the rest of the recording unplayable. Count heal attempts per target session and retry up to a bounded cap instead of latching after one. The count resets when the heal target changes, so each rotated session gets its own budget. Generated-By: PostHog Desktop Task-Id: c41cc2d8-36c0-48ff-a653-e1e6c34695df
Replay incident risk checkThis diff touches code involved in past incidents. This is a heads-up, not a verdict: read the matched sections of INCIDENTS.md and answer their review questions before merging. For a judgment on whether this diff has the same failure mode, run the |
|
Size Change: +664 B (0%) Total Size: 19.9 MB 📦 View Changed
ℹ️ View Unchanged
|
posthog-js Compliance ReportDate: 2026-08-20 17:47:19 UTC ✅ All Tests Passed!26/26 tests passed Capture Tests✅ 26/26 tests passed View Details
|
The bounded heal retry adds a private _fullSnapshotHealAttempts field. Register it in terser-mangled-names.json so the mangled-property consistency check passes. Generated-By: PostHog Desktop Task-Id: c41cc2d8-36c0-48ff-a653-e1e6c34695df
Pull request risk assessment: REVIEWI checked commit
One check needs human review. This result does not mean the change is incorrect or should be closed. Review pointsKeep the retry. Check whether queued incrementals can avoid requesting another FullSnapshot after rrweb has already emitted one. |
Problem
lazy-loaded-session-recorder.tshas a heal path for this, but it requested one full snapshot per target session id and then latched off (_fullSnapshotHealAttemptedFor).Changes
MAX_FULL_SNAPSHOT_HEAL_ATTEMPTS = 5)._lastFullSnapshotSessionIdguard stops further heals, so the cap only matters while a heal keeps failing.MAX_FULL_SNAPSHOT_HEAL_ATTEMPTSconstant.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Fully autonomous
_ensureFullSnapshotForSession: a heal that never produced a full snapshot could not retry, so the recording stayed unplayable. Chose a bounded per-session retry (reset on target change) over an unbounded retry to avoid a loop when every take keeps failing.lazy-sessionrecording-compression.test.ts(9 passed) andlazy-sessionrecording.test.ts(360 passed). Did not run the full monorepo typecheck — the local@posthog/coreworkspace build was only partially available.session_idle_threshold_ms) and is a configuration answer, so it is out of scope here.Created with PostHog Desktop from this inbox report.