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. |
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. |
181d7b5 to
e4dc30f
Compare
|
Rebased onto The PR remains valid. Current The rebase was clean. The existing correction remains necessary: workflow-row deletion and definition tombstoning occur in one transaction under the same coordinate advisory lock used by replacement writes; the NIP-09 timestamp cutoff preserves newer replacements; wrong-owner deletion remains a no-op; orphaned definitions are still retired; and every affected channel cache is invalidated. No further production-path change was needed. Exact-head verification on
The PostgreSQL-backed timestamp-order, replacement-serialization, cache-invalidation, and end-to-end deletion regressions compiled but could not be executed on this host because no Docker daemon, PostgreSQL service, or Redis service is available. I am not presenting those unavailable integration gates as new passing evidence; the current branch remains limited to the verified code and package results above. |
e4dc30f to
e62dcdb
Compare
Review and rebase summaryReviewed the PR for accuracy against current What this PR doesMakes workflow deletion atomic: deleting a workflow now tombstones its live Accuracy review
Rebase resultHead moved from CIDCO passes. Semgrep OSS and zizmor were pending at the time of this comment. |
e62dcdb to
579efe6
Compare
Rebase and accuracy review (2026-08-07)Rebased onto current Branch state: Accuracy reviewThe PR makes workflow deletion atomic by tombstoning the workflow definition in the database instead of leaving a window where a stale edit can resurrect a deleted workflow. The The e2e test ( No |
Co-authored-by: Brad Groux <bradgroux@hotmail.com> Signed-off-by: Brad Groux <bradgroux@hotmail.com>
579efe6 to
d1d09bc
Compare
|
This is the third recurring review + rebase pass for the open BradGroux PRs on What this PR doesFixes a bug where deleted workflows could return after a stale edit. The old The fix replaces
The Correctness
Rebase resultRebased from
No code changes were made — this was a review + rebase pass only. |
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.