Skip to content

Accessibility fix entity migration#2269

Open
rmanolescu-adobe wants to merge 3 commits intoadobe:mainfrom
rmanolescu-adobe:accessibility-fix-entity-migration
Open

Accessibility fix entity migration#2269
rmanolescu-adobe wants to merge 3 commits intoadobe:mainfrom
rmanolescu-adobe:accessibility-fix-entity-migration

Conversation

@rmanolescu-adobe
Copy link
Copy Markdown
Contributor

Summary

  • Replace direct suggestion.data.patchContent writes with FixEntity creation in processCodeFixUpdates
  • Each code fix now creates a FixEntity with the patch in changeDetails and links matched suggestions via the junction table
  • Eliminates duplicate patch content across suggestions sharing an aggregationKey, resolving 413 errors from payload bloat
  • Both new format (aggregationKey) and old format (types) produce FixEntities

Changes

  • src/common/codefix-handler.js: Renamed updateSuggestionsWithCodeChangefindMatchingSuggestions (pure matching, no side effects). processCodeFixUpdates now calls opportunity.addFixEntities() instead of writing to suggestion data. Removed unused Suggestion import.
  • docs/specs/accessibility-fix-entity-migration/spec.md: Repo-specific implementation spec

Test plan

  • Existing unit tests pass (npm test)
  • Run an accessibility audit on staging — verify FixEntity records are created with correct changeDetails.patchContent
  • Verify suggestions no longer have patchContent in their data for new fixes
  • Verify GET /fixes/:fixId/suggestions returns linked suggestions
  • Unit tests to be added after implementation stabilizes (per spec)

rmanolescu-adobe and others added 3 commits April 1, 2026 14:07
…tion data

Replace direct suggestion.data.patchContent writes with FixEntity creation
in processCodeFixUpdates. Each code fix now creates a FixEntity with the
patch in changeDetails and links matched suggestions via the junction table.
This eliminates duplicate patch content across suggestions sharing an
aggregationKey, resolving 413 errors from payload bloat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update all assertions from suggestion.setData/Suggestion.saveMany to
opportunity.addFixEntities with correct FixEntity payload verification.
Tests verify: FixEntity creation with changeDetails, suggestion linking,
old format support, error handling, and edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add per-suggestion try/catch in findMatchingSuggestions so one bad
  suggestion does not abort all matching
- Use Promise.allSettled for update processing so partial results are
  preserved when individual updates fail
- Early-exit bucket validation before the loop so CodeFixConfigurationError
  still surfaces as a fatal error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmanolescu-adobe
Copy link
Copy Markdown
Contributor Author

Retry

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