Repository navigation
Add a customer Stop link to cancel a screening - #9
Merged
Merged
Conversation
The confirmation email now carries a separate, request-bound Stop link whose token is stored only as a hash (schema 2 adds stop_token_hash; the dbDelta upgrade adds it in place). GET shows a Stop form and changes nothing, so email prefetches are harmless. A nonce-protected POST cancels the job as customer_stopped under the queue lock, clearing any lease and confirmation token. The existing start and result guards then refuse it, and it is never claimed again. Repeat stops are idempotent. Stopping a finished job changes nothing, and customer stops do not set the operator revoked_at flag, so a confirmed customer's report path is unaffected. A check the worker already started may still finish its current requests; a per-request admission guard is the follow-up. Refs CompleteTech-LLC/complete.tech#17 (gap 3, part 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part 1 of gap 3 in CompleteTech-LLC/complete.tech#17: a customer stop control.
Change
?action=ct_scan_stop&stop=<token>). It uses a different parameter from the confirmationtoken=. The token is stored only asstop_token_hash; schema 2 adds the column throughdbDelta.ct_scan_customer_stop(). Under the queue lock, that setscancelled/customer_stoppedand clears the lease and confirmation token.leased, results return 410 forcancelled, and claims only takequeued. Repeat stops returnalready_stopped; a finished job returnsalready_finishedand is untouched.revoked_at(the operator flag), so a confirmed customer can still be sent an appropriate report.docs/WORDPRESS.mdnotes the semantics and the remaining limit: an already-started check may finish its current requests until the per-request admission guard (part 2) lands.Verification (disposable WordPress + MariaDB fixture)
integration.phppasses. New cases: stop link present and distinct from the confirmation token, hash-only storage, wrong token rejected, a token can't stop another job, a leased job stopped by its customer, stale start and late result return 410, idempotent repeat, never claimed again.🤖 Generated with Claude Code