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

#9156: tab synchronized mod variable storage (3/3) #9181

Merged
merged 22 commits into from
Sep 23, 2024

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Sep 20, 2024

What does this PR do?

Remaining Work

  • Rebase vs. main

Demo

  • See Playwright test

Future Work

  • Playwright fixtures to assert browser.session.storage contents, to automatically check that the tab/deactivation listeners are working properly

For more information on our expectations for the PR process, see the
code review principles doc

@twschiller twschiller added the do not merge Merging of this PR is blocked by another one label Sep 20, 2024
@twschiller twschiller self-assigned this Sep 20, 2024
@twschiller twschiller added the enhancement New feature or request label Sep 20, 2024
@twschiller twschiller added this to the 2.1.3 milestone Sep 20, 2024
@twschiller twschiller changed the title #9156: tab synchronized mod variable storage #9156: [WIP] tab synchronized mod variable storage Sep 20, 2024
@twschiller twschiller changed the title #9156: [WIP] tab synchronized mod variable storage #9156: [WIP] tab synchronized mod variable storage (3/3) Sep 21, 2024
@twschiller twschiller changed the title #9156: [WIP] tab synchronized mod variable storage (3/3) #9156: tab synchronized mod variable storage (3/3) Sep 21, 2024
@twschiller twschiller marked this pull request as ready for review September 21, 2024 15:37
Comment on lines +69 to +80
let values = await browser.storage.session.get();
expect(Object.keys(values)).toHaveLength(2);

// Delete unrelated mod variables
await deleteSynchronizedModVariablesForMod(modComponentRefFactory().modId);
values = await browser.storage.session.get();
expect(Object.keys(values)).toHaveLength(2);

// Delete mod variables
await deleteSynchronizedModVariablesForMod(modComponentRef.modId);
values = await browser.storage.session.get();
expect(Object.keys(values)).toHaveLength(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: This test could be improved by having sessionStorage have variables for 2 different mod ids and confirming that only the variables for the intended modId are deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

Base automatically changed from feature/9154-session-sync to main September 23, 2024 19:51
Add state controller test

9154: add E2E runtime test

Improve comments

Refactor dipatch method

Fix type errors
Improve method names

Add jest tests

Split up state controller

Remove performance note
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 88.11881% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.81%. Comparing base (8318d74) to head (86d0070).
Report is 312 commits behind head on main.

Files with missing lines Patch % Lines
...ipt/stateController/modVariablePolicyController.ts 80.00% 8 Missing ⚠️
src/background/stateControllerListeners.ts 88.23% 2 Missing ⚠️
src/background/background.ts 0.00% 1 Missing ⚠️
src/store/deactivateUtils.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9181      +/-   ##
==========================================
+ Coverage   74.24%   74.81%   +0.56%     
==========================================
  Files        1332     1364      +32     
  Lines       40817    42036    +1219     
  Branches     7634     7850     +216     
==========================================
+ Hits        30306    31448    +1142     
- Misses      10511    10588      +77     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Sep 23, 2024

Playwright test results

passed  132 passed
flaky  2 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  138 tests across 45 suites
duration  25 minutes, 57 seconds
commit  86d0070
info  For more information on how to debug and view this report, see our readme

Flaky tests

chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

@twschiller twschiller merged commit 9d4cf78 into main Sep 23, 2024
20 checks passed
@twschiller twschiller deleted the feature/9156-tab-sync-policy branch September 23, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Merging of this PR is blocked by another one enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slice 3: Add state controller support for tab synchronization policy
2 participants