fix(forms-a11y): keep handler that normalizes Mystique a11y payload to update_from/target_selector for codefix-handler compatibility.#2038
Conversation
|
This PR will trigger a patch release when merged. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| severity: (issue.severity ?? issue.Severity) === 'critical' ? 'critical' : 'serious', | ||
| failureSummary: String(issue.failureSummary ?? issue.failure_summary ?? ''), | ||
| htmlWithIssues: normalizedHtml, | ||
| aiGenerated: Boolean(issue.aiGenerated ?? issue.ai_generated ?? true), |
There was a problem hiding this comment.
The problem I see with this approach is we are storing both camelCase as well as snakeCase. This will cause confusion in the future
There was a problem hiding this comment.
The normalizer accepted both camelCase (from Mystique) and snake_case as input but always returned snake_case. Reading both shapes in the normalizer and in consumers made it look like I was storing both formats.
What I changed: I now treat snake_case as the only format in the pipeline: normalize at every entry point (including extractFormAccessibilityData), consumers only read update_from and target_selector, and I added a test that camelCase input is normalized to snake_case. CamelCase is only accepted at the Mystique boundary and is converted immediately, so I no longer store or propagate both.
Should that be fine? updating the commit.
There was a problem hiding this comment.
I meant for the other attributes. only htmlWithIssues uses snake_case while the entire object uses camelCase (aiGenerated). A comment why partial object is snake_case would be a good thing here.
d01d18c to
66cf393
Compare
| severity: (issue.severity ?? issue.Severity) === 'critical' ? 'critical' : 'serious', | ||
| failureSummary: String(issue.failureSummary ?? issue.failure_summary ?? ''), | ||
| htmlWithIssues: normalizedHtml, | ||
| aiGenerated: Boolean(issue.aiGenerated ?? issue.ai_generated ?? true), |
There was a problem hiding this comment.
I meant for the other attributes. only htmlWithIssues uses snake_case while the entire object uses camelCase (aiGenerated). A comment why partial object is snake_case would be a good thing here.
…o update_from/target_selector for codefix-handler compatibility.
…t_selector) Normalize at all entry points, have consumers read only snake_case, and add a test for camelCase input.
66cf393 to
7c68e93
Compare
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!