Commit 4d8e1a8
feat(suggestions): allow OUTDATED status in auto-fix allowlist
OUTDATED alt-text suggestions are re-detections of previously-FIXED
rows where the producer found the issue still present on the live URL
(after the publish-lag reset gate). The experience-success-studio-ui
PR #1914 surfaces OUTDATED in the Current tab so customers can retry
the deploy, but the auto-fix controller's status gate only accepted
NEW and PENDING_VALIDATION — silently rejecting OUTDATED with 400
inside a 207 response. The UI today treats 2xx as success, so the
customer sees a "Success" toast while nothing actually re-deploys.
This 3-line allowlist relaxation closes the gap. The rest of the
round-trip is already status-agnostic:
- bulkUpdateStatus is source-status-agnostic (verified in
spacecat-shared-data-access: no state machine, no transition
rules, no hooks — just enum membership check on the target value)
- autofix-worker queries by opportunity_id + IN_PROGRESS, origin
status is invisible to it
- alt-text handler reads recommendations[0].altText, writes alt,
transitions IN_PROGRESS → FIXED — status-agnostic
- mystique projector and publish-lag reset gate are timestamp-driven,
not status-driven
So OUTDATED → IN_PROGRESS → (apply) → FIXED is now the supported flow.
Tests:
- Updated existing assertion to reflect new error message
- Added new test asserting OUTDATED is accepted, bulkUpdateStatus
transitions it to IN_PROGRESS, and the 207 response reports
success=1 / failed=0
All 404 suggestions controller tests pass, no regressions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d7889ac commit 4d8e1a8
2 files changed
Lines changed: 43 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1154 | 1163 | | |
1155 | 1164 | | |
1156 | 1165 | | |
1157 | 1166 | | |
1158 | 1167 | | |
1159 | 1168 | | |
1160 | | - | |
| 1169 | + | |
1161 | 1170 | | |
1162 | 1171 | | |
1163 | 1172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4608 | 4608 | | |
4609 | 4609 | | |
4610 | 4610 | | |
4611 | | - | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
4612 | 4644 | | |
4613 | 4645 | | |
4614 | 4646 | | |
| |||
0 commit comments