fix(workflow): stop deleted workflows from returning after a stale edit - #6639
fix(workflow): stop deleted workflows from returning after a stale edit#6639BradGroux wants to merge 1 commit into
Conversation
Co-authored-by: Brad Groux <bradgroux@hotmail.com> Signed-off-by: Brad Groux <bradgroux@hotmail.com>
e8bfc03 to
8d1f7f7
Compare
|
Rebased onto the latest Conflict resolution: The PR's The core change — atomic workflow deletion with advisory locking, timestamp-cutoff tombstoning, and affected-channel cache invalidation in CI will verify the build and test gate. |
Fixes #2390.
What users saw
A deleted workflow could return after someone edited a stale copy. A later delete removed the workflow row again, but the replacement definition could remain queryable on the relay.
What changed
Canonical workflow deletion now uses one database transaction that:
created_at, as required by NIP-09;The timestamp cutoff prevents a replayed tombstone from deleting a newer replacement. The complete affected-channel result also closes an orphan-repair gap where the database could tombstone a definition while leaving a stale query result cached.
Safety and scope
The existing validator still proves signer authority. The database mutation independently scopes the row and definitions by community and owner.
This PR does not add a permanent resurrection ban, sweep legacy name aliases, or change Desktop refetch behavior. It complements rather than replaces the separate work on legacy/name no-op handling and effective agent-author attribution.
Verification
cargo fmt --all -- --checkcargo clippy -p buzz-db -p buzz-relay -p buzz-test-client --all-targets --all-features -- -D warningscargo test -p buzz-db tests::coordinate_delete_spares_head_newer_than_the_deletion -- --ignored --nocapture: passed against PostgreSQL.