-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the 'key' field of Radio widgets to be null #2300
Conversation
…' field of Radio widgets to be null when parsing Perseus JSON"
Size Change: 0 B Total Size: 876 kB ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (c2db3dd) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2300 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2300 |
@@ -45,7 +45,7 @@ export function parseWidgetWithVersion< | |||
graded: optional(boolean), | |||
alignment: optional(string), | |||
options: parseOptions, | |||
key: optional(number), | |||
key: optional(nullable(number)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to your PR, but data-schema says key
is:
Only used by interactive child widgets (line, point, etc) to identify the components
Any sense for why Radio has a value for this?
Co-authored-by: Matthew <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! Glad we'll have fewer errors :)
I just realized I made a mistake skipping a test in the parser (I didn't mean to land this): https://github.com/Khan/perseus/pull/2233/files#diff-68d645e728532aa287208fa9587f48a0e0f8fcabd727a85d72f1d2e337b1024eR17 I think it's related to this work? EDIT: looks like your changes only fix some of these tests. Ping me when you land this and I'll fix the others. |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/[email protected] ### Major Changes - [#2303](#2303) [`5e7a6084c`](5e7a608) Thanks [@benchristel](https://github.com/benchristel)! - Drop support for using KaTeX as a math renderer. You may encounter styling issues or TeX syntax errors if you try to implement `PerseusDependencies.TeX` using KaTeX. ### Minor Changes - [#2284](#2284) [`0d5ab0b2e`](0d5ab0b) Thanks [@nishasy](https://github.com/nishasy)! - Add new labelLocation value for Interactive Graphs - [#875](#875) [`9737eb497`](9737eb4) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove deprecated khan-exercise.css - [#2305](#2305) [`af6d89007`](af6d890) Thanks [@Myranae](https://github.com/Myranae)! - Add a story for Dropdown that uses answerless data ### Patch Changes - [#2307](#2307) [`dd7b13a78`](dd7b13a) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Revert SSS temporarily for Radio to ensure Multiselect + Random answer correctness is accurate - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#2303](#2303) [`5e7a6084c`](5e7a608) Thanks [@benchristel](https://github.com/benchristel)! - Drop support for using KaTeX as a math renderer. You may encounter styling issues or TeX syntax errors if you try to implement `PerseusDependencies.TeX` using KaTeX. ### Minor Changes - [#2284](#2284) [`0d5ab0b2e`](0d5ab0b) Thanks [@nishasy](https://github.com/nishasy)! - Add new labelLocation value for Interactive Graphs ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea), [`9737eb497`](9737eb4), [`dd7b13a78`](dd7b13a), [`af6d89007`](af6d890), [`5e7a6084c`](5e7a608)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Minor Changes - [#2284](#2284) [`0d5ab0b2e`](0d5ab0b) Thanks [@nishasy](https://github.com/nishasy)! - Add new labelLocation value for Interactive Graphs ### Patch Changes - [#2300](#2300) [`fea65eaf1`](fea65ea) Thanks [@benchristel](https://github.com/benchristel)! - Bugfix: allow the 'key' field of Radio widgets to be null when parsing Perseus JSON ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`0d5ab0b2e`](0d5ab0b), [`fea65eaf1`](fea65ea)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected]
This fixes a bug in the parser that caused it to incorrectly reject some production data.
Reported here: https://khanacademy.slack.com/archives/C01AZ9H8TTQ/p1741876983359149
Issue: none
Test plan:
yarn test
After deployment, the number of errors on Sentry mentioning
At (root).question.widgets["radio 1"].key -- expected number, but got null
should decrease sharply.