fix(lab): make recorded replay seek-safe

This commit is contained in:
DCCONSTRUCTIONS
2026-08-24 02:15:30 +03:00
parent 7400fe2fd7
commit 992c5a8b74
12 changed files with 1096 additions and 287 deletions
@@ -953,7 +953,7 @@ test("replay decodes opaque recorded cameras and their same-origin fMP4 manifest
);
const manifest = decodeObservationRecordedMediaManifest({
schema_version: "missioncore.observation-recorded-media/v3",
schema_version: "missioncore.observation-recorded-media/v4",
source_id: source.id,
generation_sha256: "c".repeat(64),
byte_length: 3_266,
@@ -970,11 +970,17 @@ test("replay decodes opaque recorded cameras and their same-origin fMP4 manifest
"/manifest",
`/epochs/1/recording.mp4?generation=${"c".repeat(64)}`,
),
segment_count: 2,
random_access_sequences: [1],
segment_end_times_seconds: [9.75, 19.75],
}],
}, decoded.mediaSources[0]);
assert.equal(manifest.epochs[0].byteLength, 3_266);
assert.match(manifest.epochs[0].streamUrl, /recording\.mp4\?generation=/);
assert.equal(manifest.epochs[0].timelineStartSeconds, 0.25);
assert.equal(manifest.epochs[0].segmentCount, 2);
assert.deepEqual(manifest.epochs[0].randomAccessSequences, [1]);
assert.deepEqual(manifest.epochs[0].segmentEndTimesSeconds, [9.75, 19.75]);
assert.throws(
() => decodeObservationRecordedMediaManifest({
...{
@@ -992,7 +998,7 @@ test("replay decodes opaque recorded cameras and their same-origin fMP4 manifest
);
assert.throws(
() => decodeObservationRecordedMediaManifest({
schema_version: "missioncore.observation-recorded-media/v3",
schema_version: "missioncore.observation-recorded-media/v4",
source_id: source.id,
generation_sha256: "c".repeat(64),
byte_length: 3_267,
@@ -1106,7 +1112,7 @@ test("recorded camera contracts reject foreign origins, path escapes and unknown
}));
assert.throws(
() => decodeObservationRecordedMediaManifest({
schema_version: "missioncore.observation-recorded-media/v3",
schema_version: "missioncore.observation-recorded-media/v4",
source_id: base.id,
generation_sha256: "c".repeat(64),
byte_length: 384,
@@ -1120,6 +1126,9 @@ test("recorded camera contracts reject foreign origins, path escapes and unknown
media_type: 'video/mp4; codecs="avc1.640028"',
byte_length: 384,
stream_url: "file:///private/recording.mp4",
segment_count: 1,
random_access_sequences: [1],
segment_end_times_seconds: [20],
}],
}, decoded.mediaSources[0]),
/небезопасный API URL/,