mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-09 06:12:56 +00:00
storage-cors-3: preserve newer live versions on late deletion markers
This commit is contained in:
1 parent
89c5494aaa
commit
ed5fb64991
5 files changed
+162
-8
No files matched your search
@@ -168,16 +168,13 @@ export class VideoEventBuffer {
|
||||
this.client.allEvents.set(evt.id, video);
|
||||
this.client.dirtyEventIds.add(evt.id);
|
||||
|
||||
// If it's a "deleted" note, remove from activeMap
|
||||
// recordTombstone already removes active versions at or before the
|
||||
// deletion timestamp. A late/replayed marker must preserve newer ones.
|
||||
if (video.deleted) {
|
||||
if (activeKey) {
|
||||
if (wasDeletedEvent) {
|
||||
if (activeKey && !wasDeletedEvent) {
|
||||
const currentActive = this.client.activeMap.get(activeKey);
|
||||
if (currentActive?.id === video.id) {
|
||||
this.client.activeMap.delete(activeKey);
|
||||
} else {
|
||||
const currentActive = this.client.activeMap.get(activeKey);
|
||||
if (currentActive?.id === video.id) {
|
||||
this.client.activeMap.delete(activeKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
updatedVideos.push(video);
|
||||
|
||||
Reference in new issue
Block a user