1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

vue ui bug fix: duplicate snapshots of same timestamp should be de-duped; was causing a bug as code was assuming de-duped snapshots from server

This commit is contained in:
Ivan Velev 2022-02-02 15:59:44 -08:00
parent 46cc04bafd
commit 718112884f
2 changed files with 27 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -46,14 +46,20 @@ export function PywbData(rawSnaps) {
single = new PywbPeriod({type: PywbPeriod.Type.snapshot, id: snap.id});
hour.addChild(single);
}
single.setSnapshot(snap);
if (lastSingle) {
lastSingle.setNextSnapshotPeriod(single);
single.setPreviousSnapshotPeriod(lastSingle);
}
lastSingle = single;
snapshots.push(snap);
// De-duplicate single snapshots (sometimes there are multiple snapshots
// of the same timestamp with different HTTP status; ignore all
// duplicates and take the first entry regardless of status)
if (!lastSingle || lastSingle.id !== single.id) {
single.setSnapshot(snap);
if (lastSingle) {
lastSingle.setNextSnapshotPeriod(single);
single.setPreviousSnapshotPeriod(lastSingle);
}
lastSingle = single;
snapshots.push(snap);
}
// At end of snapshot loop, check period of each type: year/month/day/hour
// as all snapshots are now added to the period hierarchy