Fills the missing-shard ranges of a re-assembly from the session's previous recording.
Why: a Complete assembly deletes its shard rows (everything below its expected count). When a strictly
higher terminal later re-opens the session (the tab was hidden, a terminal went out, the call
continued), the re-assembly finds those indexes missing. Their audio lives only in the previous
recording.wav, so it is copied back rather than overwritten with silence.
Every missing range the previous file covers is reused, not only the leading one: a re-sent copy of
an assembled shard (its ack was lost, so the browser sent it again after the rows were deleted) is
stored again, and would otherwise split the deleted range and leave everything after it silent.
Reusing is safe because the previous recording's silent ranges are exactly its stored gaps: every
assembly stamps its gaps before it overwrites the object (see StampAssemblyGaps), so an assembly
that wrote silence and then failed to finish still left that silence listed. Those gaps are carried
over (clipped to each reused range) and stay gaps. The one remaining way the object can disagree is a
superseded assembler whose slow storage write lands after a newer one finished (a known, parked race).
The part of a range beyond the previous recording's length stays silent and stays a gap; the range's
rows are gone, so per-index boundaries are unknown, and the remainder lists the indexes that can hold
samples past the old end: an index i ends no later than (i + 1) * MAX_SHARD_SAMPLES, so indexes
that provably end inside the old recording are dropped.
Returns a new result (the samples are written in place) with Complete recomputed.
Fills the missing-shard ranges of a re-assembly from the session's previous recording.
Why: a Complete assembly deletes its shard rows (everything below its expected count). When a strictly higher terminal later re-opens the session (the tab was hidden, a terminal went out, the call continued), the re-assembly finds those indexes missing. Their audio lives only in the previous
recording.wav, so it is copied back rather than overwritten with silence.Every missing range the previous file covers is reused, not only the leading one: a re-sent copy of an assembled shard (its ack was lost, so the browser sent it again after the rows were deleted) is stored again, and would otherwise split the deleted range and leave everything after it silent. Reusing is safe because the previous recording's silent ranges are exactly its stored gaps: every assembly stamps its gaps before it overwrites the object (see
StampAssemblyGaps), so an assembly that wrote silence and then failed to finish still left that silence listed. Those gaps are carried over (clipped to each reused range) and stay gaps. The one remaining way the object can disagree is a superseded assembler whose slow storage write lands after a newer one finished (a known, parked race).The part of a range beyond the previous recording's length stays silent and stays a gap; the range's rows are gone, so per-index boundaries are unknown, and the remainder lists the indexes that can hold samples past the old end: an index
iends no later than(i + 1) * MAX_SHARD_SAMPLES, so indexes that provably end inside the old recording are dropped.Returns a new result (the samples are written in place) with
Completerecomputed.