Skip to content

Commit

Permalink
When removing a person list, remove any associated pending items
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Sep 28, 2024
1 parent 26f5f1c commit 1672b43
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gossip-lib/src/overlord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::manager;
use crate::minion::MinionExitReason;
use crate::misc::{Private, ZapState};
use crate::nostr_connect_server::{Approval, ParsedCommand};
use crate::pending::PendingItem;
use crate::people::{Person, PersonList};
use crate::relay;
use crate::relay::Relay;
Expand Down Expand Up @@ -1141,6 +1142,17 @@ impl Overlord {
GLOBALS.db().deallocate_person_list(list, Some(&mut txn))?;
txn.commit()?;

// Remove from pending
GLOBALS
.pending
.remove(&PendingItem::PersonListNeverPublished(list));
GLOBALS
.pending
.remove(&PendingItem::PersonListOutOfSync(list));
GLOBALS
.pending
.remove(&PendingItem::PersonListNotPublishedRecently(list));

// If we are only following, nothing else needed
if GLOBALS.db().get_flag_following_only() {
return Ok(());
Expand Down

0 comments on commit 1672b43

Please sign in to comment.