fix(workflow): stop deleted workflows from returning after a stale edit - #2489
fix(workflow): stop deleted workflows from returning after a stale edit#2489BradGroux wants to merge 1 commit into
Conversation
a350356 to
0c36797
Compare
|
I rebased this branch onto current The core transaction remains relevant. The audit found one remaining defect: when the workflow row was already missing but live definitions still existed, the database tombstoned those definitions yet returned no row channel. The relay therefore had no cache key to invalidate, so a stale query result could survive a successful orphan cleanup. Head The affected package suites, strict Clippy, and Rust formatting were refreshed. The non-database tests passed. Nine unrelated relay media/admin tests could not obtain this host's local PostgreSQL pool, and a serial rerun hit the same boundary. The new ignored lifecycle regression compiled, but I am not presenting the unavailable database run as passing evidence. This remains intentionally separate from legacy alias policy, Desktop refetch behavior, and the other deletion/attribution PRs noted in the updated body. |
0c36797 to
7345b84
Compare
|
Rebased this branch onto current Head moved from Verification:
GitHub checks are rerunning on the new head. |
Co-authored-by: Brad Groux <bradgroux@hotmail.com> Signed-off-by: Brad Groux <bradgroux@hotmail.com>
7345b84 to
181d7b5
Compare
|
Rebased onto current The current-main audit exposed a NIP-09 safety gap in the old branch: its workflow transaction tombstoned every live definition at the coordinate, even if the signed deletion event was older than a replacement. The refreshed transaction now applies the deletion event's Published head: Verification passed for formatting, strict Clippy across the affected database, relay, and test-client packages, and the PostgreSQL-backed between-version tombstone regression. |
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.