Skip to content

Retry clean policy contention before physical file deletion - #238

Merged
canvascoding merged 1 commit into
mainfrom
codex/physical-delete-policy-admission
Nov 9, 2026
Merged

canvascoding merged 1 commit into
mainfrom
codex/physical-delete-policy-admission

Conversation

@canvascoding

Copy link
Copy Markdown
Owner

A single-file Delete could return HTTP 409 and leave the original job needing recovery when another transaction briefly held the organization row. The conflict occurred after the Delete intent was stored, but before the file moved or a receipt was written.

The direct physical Delete preflight now retries only a failed authorization entry after a confirmed rollback. It checks the same claim and current permissions on each attempt, with three bounded delays. The file move and receipt writes still happen once; persistent contention, revoked access and uncertain outcomes fail closed.

Validation: reproduced the PostgreSQL row lock on the previous code. The new regression passes with the lock released, with permissions revoked before the next check, and with the lock held through the retry limit. The passing case verifies one intent, one completion and byte-identical Trash content; both refusal cases preserve the source. Release typecheck and targeted ESLint passed. The PostgreSQL regression runs in Native API and SDK CI.

@canvascoding
canvascoding merged commit 571b276 into main Nov 9, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant