Skip to content
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

fix: ensure default store data is merged with persisted data during VisualizationStore initialization #6231

Merged

Conversation

madalynrose
Copy link
Contributor

Details

When there is persisted data in IndexedDB for the VisualizationStore and storeData.tests is missing the mediumPass key, the WebConfigurationVisualizationFactory hits an error. This PR overrides generateDefaultState for VisualizationStore (called during initialize()), allowing us to ensure that default state is generated for test modes not present in persistedData. This implementation is based on AssessmentStore, which is the only other store that overrides this method. It pulls initial data generation logic into a separate class to facilitate testing.

Motivation

This PR addresses an issue seen in Canary where adhoc visualizations are nonfunctional and the service worker logs the following error:
Error while processing browser RuntimeOnMessage event: TypeError: Cannot read properties of undefined (reading 'keyboardInteractionAssessment')

Pull request checklist

  • [n/a] Addresses an existing issue: #0000
  • Ran yarn null:autoadd
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • [n/a] (UI changes only) Added screenshots/GIFs to description above
  • [n/a] (UI changes only) Verified usability with NVDA/JAWS

@madalynrose madalynrose requested a review from a team as a code owner December 2, 2022 19:47
Copy link
Contributor

@dbjorge dbjorge left a comment

Choose a reason for hiding this comment

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

The restructuring into the separate initializer class LGTM, left a few comments on the initializer merging algorithm

@madalynrose madalynrose requested a review from dbjorge December 2, 2022 20:35
@madalynrose madalynrose changed the title fix: ensure all test modes are included during VisualizationStore initialization fix: ensure default store data is merged with persisted data during VisualizationStore initialization Dec 2, 2022
@madalynrose madalynrose merged commit d20640b into microsoft:main Dec 2, 2022
@madalynrose madalynrose deleted the fix-visualization-store-init branch December 2, 2022 20:43
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