upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 09:24:01 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 09:24:01 +0000
commit0c01797812bb77fc81d0efe58f0e7858f2b7af66 (patch)
tree9310aca4f3e921ca9950a2b11af23ea82788b98b /src/git
parent467690f33bbbfd442852e61de221e4e5e161b878 (diff)
fix: handle announcement replacement when original is still in purgatory
Previously, has_active_announcement() only queried the database, so when a newer announcement arrived for the same (pubkey, identifier) while the original was still in purgatory, it was incorrectly routed as a brand-new announcement (AcceptPurgatory) rather than replacing the existing entry. This change splits the logic into two cases: - If the existing entry is in the database: return Accept (replacement) as before - If the existing entry is only in purgatory: replace the purgatory entry via add_announcement() (which overwrites by key) and extend expiries for both the announcement and any waiting state events, then return Accept - If the owner sends a Reject-classified announcement (service removed) but has a purgatory entry: clear the purgatory entry, delete the bare repo, and remove any waiting state events before rejecting Also add an explicit comment to find_accepted_repository() in related.rs clarifying that it intentionally only checks the database. Related events should only be accepted after the repository announcement has been promoted (validated via git data) - this is correct behaviour, not a missing check.
Diffstat (limited to 'src/git')
0 files changed, 0 insertions, 0 deletions