Repository navigation
fix(action-center): give Check now its own rate bucket, its own words for each task it can't check, and show it only where the API checks - #1683
Merged
Conversation
…, cap each brand's night, and check after the task writer Follow-ups C (round 36's items 6, 7 and 11) from ansvisor#1565's round 37. Item 6: tasks the sweep can't check stayed at the head of its queue. Nothing was written when no address could be made (a URL typed as `acme.example pricing`, a path on a brand with no domain) or when reading threw, so those rows kept a null or old triedAt and came first every night. runTaskCheck now writes triedAt first, as a claim on the task as it was read (the bot-log crawler case's own write goes, the claim keeps its try); the result is written on the claim. A run that read the task before another claimed it gets 'changed' and reads nothing, so two runs never check one task. Item 7: one brand could take the night, and the checks didn't wait for the task writer. - The sweep checks at most SWEEP_PER_BRAND (20) of one brand's tasks a night, and reads up to 5 pages of 1,000 rows (ordered by triedAt, then id) to fill its 200. - server.js starts the checks once sweepActionTasks settles: the writer can delete a task a check just completed. Item 11: the sweep's query (the `or` with a JSON path, the order on details->autoCheck->>triedAt, the range) ran against the dev DB, over a seeded demo-brand task with a stub page: claimed, checked, completed, one History line; the temp action and task were deleted after. The guide's Automatic line says 20 of one brand's, least recently tried first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for each task it can't check, and show it only where the API checks Follow-up C (round 36's item 8) from ansvisor#1565's round 37. Stacked on fix/task-check-sweep-queue: both change runTaskCheck's first lines. - Check now shared pageReadLimiter with Quality's page read, an AI-cost route, so clicks here used up the editor's reads. It has its own taskCheckLimiter (30 per 15 minutes). - "not_checkable" said "a Site Audit fix is checked by your next audit" for every task without a check. runTaskCheck now names why: no_address (no URL, or one that isn't a page's address), no_change_text (a written task with no new text to look for), from_bot_logs (a crawler fix raised from the bot logs, which robots.txt can't show done), and not_checkable for a library task checked elsewhere, as before. Each has its line in checkNot. - The drawer showed Check now on every open Automatic task with a URL. It shows it where the API checks (pageCheckable): a library task in its CHECKS, or a written task with its new text. PAGE_CHECKED_TASKS copies the CHECKS keys; a test reads the server file and fails if they drift. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 12 tasks
# Conflicts: # server/src/lib/action-center/task-checks.js
The drawer's pageCheckable allowed only a library task it checks on its page or a written task with new text, so the shopping links task (no task key, no new text) lost Check now. Pass the action's kind and allow a shopping_links action's task.
7 of 12 tasks
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.
Summary
Follow-up C from #1565's round 37 (round 36's item 8): Check now gets its own rate bucket, its own words for each task it can't check, and shows only where the API checks.
Stacked on #1682: both change
runTaskCheck's first lines. This PR's own commit is be4b544.Check now shared
pageReadLimiterwith Quality's page read, which is an AI-cost route, so clicks here used up the editor's reads. It now has its owntaskCheckLimiter: 30 per 15 minutes, keyed by user (or IP)."not_checkable" used to say "a Site Audit fix is checked by your next audit" for every task without a check.
runTaskChecknow names why:no_address: no URL, or one that isn't a page's address;no_change_text: a written task with no new text to look for;from_bot_logs: a crawler fix raised from the bot logs, which robots.txt can't show done;not_checkable: a library task checked elsewhere, as before.Each has its own line in
checkNot.The drawer showed Check now on every open Automatic task with a URL. It now shows it only where the API checks (
pageCheckable): a library task in itsCHECKS, or a written task with its new text.PAGE_CHECKED_TASKScopies theCHECKSkeys. A test reads the server file and fails if the two lists drift.Server and web change together here, so they should deploy together. An older web would show the new reasons' keys as raw text.
Where people see it: Action Center › a task's drawer: the Check now button, and the line under it when a task can't be checked.
Related issue
Follow-up from #1565 (round 37, item C).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd server && npx vitest run src/lib/action-center/task-checks.test.jscd web && npx vitest run src/lib/action-center/task-details.test.tsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Full checks were run in one tree with this batch's eight follow-up branches merged (after the review fixes):
npm test(noSUPABASE_*env, as in CI): 249 files, 3,365 tests passed;vitest(445 files, 4,353 tests) and build: all pass.Browser check (local, 1024 px): Prompts › Topics › Add Topic stops at 100 characters; the Action Center drawer opens without errors, and Check now doesn't show on tasks the API doesn't check.
A pre-push review was run on all eight branches of this batch, and its before-merge findings are fixed.
🤖 Generated with Claude Code