fix(relay): tombstone kind:30620 event row on NIP-09 a-tag workflow deletion#2268
Open
s00ly wants to merge 1 commit into
Open
fix(relay): tombstone kind:30620 event row on NIP-09 a-tag workflow deletion#2268s00ly wants to merge 1 commit into
s00ly wants to merge 1 commit into
Conversation
…eletion handle_a_tag_deletion's KIND_WORKFLOW_DEF branch deleted the workflows projection row but never tombstoned the underlying kind:30620 event row, so REQ subscribers (e.g. `buzz workflows list`) kept receiving the deleted definition. Tombstone the event row by NIP-33 coordinate on both deletion paths: the UUID path (a-tag d == workflow id == event d-tag) and the name path (resolve the row, tombstone by id). The UUID-path tombstone is unconditional, which also heals pre-fix rows whose projection is already gone but whose event row stayed live. Verified nothing operational relies on the row staying live: the workflow engine and webhook bridge load from the workflows table, and audit lookups use get_event_by_id_including_deleted. Regression coverage: e2e_workflow_def_deletion.rs (UUID + name paths), verified to fail against unfixed code and pass with the fix. Fixes block#717 Signed-off-by: Sooly Kobayashi <yloos@protonmail.com>
s00ly
force-pushed
the
fix/relay-workflow-def-a-tag-tombstone
branch
from
July 21, 2026 19:49
4c859b8 to
1917bc0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
handle_a_tag_deletion'sKIND_WORKFLOW_DEFbranch deletes theworkflowsprojection row but never tombstones the underlying kind:30620 event row, so
REQ subscribers (e.g.
buzz workflows list) keep receiving the deleteddefinition. Fixes #717 — same bug shape as #714, scoped to the workflow kind
(the generic NIP-33 arm added for #714 intentionally excluded it).
Implementation
Tombstone the event row via
soft_delete_by_coordinateon both deletion paths:row's d-tag (
handle_workflow_defrequiresd= workflow UUID).resolve the workflow row first and tombstone by its id.
projection is already gone but whose event row stayed live (re-sending the
deletion now converges them).
The coordinate uses the a-tag's pubkey — the NIP-33 author — matching what
validate_standard_deletion_eventauthorized.Verified nothing operational relies on the row staying live: the workflow
engine and the webhook bridge load definitions from the
workflowstable(never the events row), and audit lookups go through
get_event_by_id_including_deleted, which is tombstone-tolerant by design.Composes with #2242 (same function, different concern: that PR aligns who
the projection delete targets; this one adds the missing event tombstone).
Happy to rebase over whichever lands first.
Testing
New
crates/buzz-test-client/tests/e2e_workflow_def_deletion.rs(2 tests:UUID deletion, name deletion). Verified against a local relay
(postgres/redis/minio via docker compose):
main: both tests FAIL (deleted def still served)e2e_long_formsuite (the relay: NIP-09 a-tag deletion is a no-op for kind:30023 (and all non-workflow addressables) #714 generic NIP-33 arm): 8/8 PASScargo clippy --all-targets --all-features -- -D warnings: cleancargo fmt --all -- --check: cleanjust cinot run end-to-end locally (desktop/mobile toolchain versions onthis machine); no desktop or mobile files touched — relying on GitHub CI for
those legs.
Checklist
cargo fmt+clippy -D warningscleanunwrap()in production code pathsunsafeblocks