1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-25 07:27:47 +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,6 +46,11 @@ export function PywbData(rawSnaps) {
single = new PywbPeriod({type: PywbPeriod.Type.snapshot, id: snap.id});
hour.addChild(single);
}
// 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);
@ -54,6 +59,7 @@ export function PywbData(rawSnaps) {
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