You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session Replay: malformed or truncated .ongoing_segment line crashes ReplayCache.fromDisk with IndexOutOfBoundsException #6806
Have an .ongoing_segment file inside replay_<replayId> that contains a line without = (for example, a truncated line such as config.heig left behind if the process is killed mid-writeText(), a blank line, or a screenAtStart value containing a newline since screenAtStart is not filtered for \n/\r the way recording metadata keys are in BaseCaptureStrategy.persistMetadataValue).
Call ReplayCache.fromDisk(options, replayId) (as ReplayIntegration.finalizePreviousReplay() does on next app launch) or ReplayCache.persistSegmentValues(...) on a fresh ReplayCache instance backed by that file.
Expected Result
Malformed lines in .ongoing_segment should be skipped safely or treated as corrupt segment metadata so ReplayCache.fromDisk() deletes the broken replay_<replayId> directory, returns null, and lets finalizePreviousReplay() proceed to cleanupReplays().
lines.associateTo(lastSegment) {
val (k, v) = it.split("=", limit =2)
k to v
}
Any line without = throws java.lang.IndexOutOfBoundsException: Index: 1, Size: 1. In ReplayIntegration.finalizePreviousReplay(), that exception aborts the task before cleanupReplays() runs and leaves the corrupt replay_<replayId> folder on disk.
hi @sahuadarsh0 thanks for the report! Have you experienced this issue in production? At worst, you'd lose the last segment of a previous replay, but there should be no production crash or anything. I'd also imagine this can rarely happen, so I'd qualify this issue as low-prio or even close it, unless you have the data to back it up that it happens a lot. Thanks!
Spotted this during code review while working on #6804 rather than from a production crash, so no production telemetry behind it. Totally fine to keep it low-prio or close it.
Activity
linear-code commentedon Nov 29, 2026
JAVA-860
romtsn commentedon Dec 1, 2026
hi @sahuadarsh0 thanks for the report! Have you experienced this issue in production? At worst, you'd lose the last segment of a previous replay, but there should be no production crash or anything. I'd also imagine this can rarely happen, so I'd qualify this issue as low-prio or even close it, unless you have the data to back it up that it happens a lot. Thanks!
sahuadarsh0 commentedon Dec 1, 2026
Spotted this during code review while working on #6804 rather than from a production crash, so no production telemetry behind it. Totally fine to keep it low-prio or close it.
romtsn commentedon Dec 1, 2026
@sahuadarsh0 thanks, closing then due to weak production evidence!