Skip to content

fix(action-center): pass another action's structured data fix only after a check found the page failing - #1680

Merged
gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:fix/task-check-structured-fallback
Oct 28, 2026
Merged

gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:fix/task-check-structured-fallback

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up B (first half) from #1565's round 37: an Action Center task to fix structured data, raised by another check, passes only after a check found the page failing.

F06 (raised by brand-entity / entity-coverage) also has an Automatic fix_structured_data task. None of its checks is a structured data check, so the task's check falls back to json-ld-validity. A page that already had one valid block (a site-wide Organization) passed on the first night with nothing fixed.

  • When no structured data check is named, the task now passes only after a check on the same page found it failing.
    • That check keeps sawFailing on the task's autoCheck, the same way wasMissing is kept, carried through later checks of the page.
  • Until then, a valid page reads valid_before. The card says: "the structured data was already valid at the first check: mark the task done once it's fixed".
  • A check named by the audit works as before.

Merge together with #1681 (the @graph context fix), in one deploy before a nightly sweep. Merged alone in either order, F06 tasks on WordPress @graph pages can close wrongly:

Known limit: an older task with no sawFailing that was fixed between its last check and this deploy stays at valid_before until it's marked done by hand. The card says so.

Where people see it: Action Center › a structured data task's drawer ("How we check" and its last check line).

Related issue

Follow-up from #1565 (round 37, item B).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

cd server && npx vitest run src/lib/action-center/task-checks.test.js

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run in one tree with this batch's eight follow-up branches merged (after the review fixes):

  • server format, lint and npm test (no SUPABASE_* env, as in CI): 249 files, 3,365 tests passed;
  • web format, lint (0 errors; 7 warnings already on main), typecheck, 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

…ter a check found the page failing

Follow-up B (first half) from ansvisor#1565's round 37. F06 (raised by
brand-entity / entity-coverage) also has an Automatic fix_structured_data.
None of its checks is a structured data check, so the check falls back to
json-ld-validity, and a page that already had one valid block (a
site-wide Organization) passed the first night with nothing fixed.

With no structured data check named, the check now passes only after a
check on the same page found it failing: that check keeps `sawFailing`
on the task's autoCheck (as `wasMissing` is kept), carried through later
checks of the page. Until then a valid page reads `valid_before`, worded
on the card as "the structured data was already valid at the first
check: mark the task done once it's fixed". A check named by the audit
works as before.

The other half of B (a @graph's nodes read without the wrapper's
@context) is its own PR, as asked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0760ad0.

Approve preview

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with follow-ups.

What I checked:

  • The change. 679acda on 3f6a4d4.
  • Merge. On b591947 it conflicts in one place: web/messages/en.json, where #1616 added links_not_for_sale as the last taskCheckMissing key. Keep both keys. Its server files merge clean on main, and the PR merges clean with #1679, #1681 and #1682.
  • The gate (task-checks.js:355-368, :559-562).
    • Only when no structured data check is named does the task need a failing check first. A check the audit named works as before.
    • A failing read with no checks named keeps sawFailing. It's kept through later reads of the same page, including a read that gets no answer (the old autoCheck is kept whole then), and it's dropped when the task's URL changes.
    • A page that passes with sawFailing from the same page passes. With no sawFailing, it reads valid_before, and the card says to mark the task done once it's fixed.
  • Tests. task-checks.test.js passes (32). With main's task-checks.js, both new cases fail. The four PRs together on b591947, with the conflicts resolved, pass src/lib/action-center, src/lib/audit and page-content (837 tests). The only 3 failures read web/ files, which aren't in my scratch layout, and they fail on main's tree the same way.
  • Before the API deploy. The web gets the new line and nothing uses it until the API sends valid_before. Nothing changes for anyone.

With #1681. Merge the two together, before the next API deploy, as you say. If no deployed API has run the page checks yet, no task has a stored check, so the "older task" limit in the description never comes up.

Follow-ups:

  1. The card's line has two colons (en.json:2477). It reads "Checked: the structured data was already valid at the first check: mark the task done once it's fixed". Say "the structured data was valid before the fix. Mark the task done once it's fixed", or put the advice in the drawer's How we check.

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.

2 participants