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

Refactor tab to serialize to storage #1363

Merged
merged 20 commits into from
Sep 27, 2022
Merged

Conversation

jonathanKingston
Copy link
Collaborator

@jonathanKingston jonathanKingston commented Aug 22, 2022

Reviewer: @shakyShane

Description:

  1. Create a new class to manage the state of tabs and sites.
    These need writing to session storage to allow us to restore their state after the service worker is reinitialized.

  2. Uses getters and setters in to store into the new class from tab and site.

  3. Changing the tab and site shape to have getters and setters will break the consumers of the current tab serialization also (we serialize over message passing to different contexts which turns classes into plain objects).
    So additionally we will need to manually serialize into this plain object format for sending over to different contexts; this will allow autofill, content-scope-scripts and the dashboard to retain their current usage of tab and site data.

https://app.asana.com/0/0/1202914947727988/f

Steps to test this PR:

Automated tests:

  • Unit tests
  • Integration tests
Reviewer Checklist:
  • Ensure the PR solves the problem
  • Review every line of code
  • Ensure the PR does no harm by testing the changes thoroughly
  • Get help if you're uncomfortable with any of the above!
  • Determine if there are any quick wins that improve the implementation
PR Author Checklist:
  • Get advice or leverage existing code
  • Agree on technical approach with reviewer (if the changes are nuanced)
  • Ensure that there is a testing strategy (and documented non-automated tests)
  • Ensure there is a documented monitoring strategy (if necessary)
  • Consider systems implications

Copy link
Contributor

@shakyShane shakyShane left a comment

Choose a reason for hiding this comment

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

Just a few small comments :)

shared/js/background/classes/legacy-tab-transfer.js Outdated Show resolved Hide resolved
shared/js/background/classes/legacy-tab-transfer.js Outdated Show resolved Hide resolved
shared/js/background/classes/tab.es6.js Show resolved Hide resolved
shared/js/background/classes/tab.es6.js Show resolved Hide resolved
shared/js/background/classes/tab.es6.js Show resolved Hide resolved
shared/js/background/classes/tab-state.js Outdated Show resolved Hide resolved
shared/js/background/classes/tab-state.js Show resolved Hide resolved
Copy link
Contributor

@shakyShane shakyShane left a comment

Choose a reason for hiding this comment

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

🚀

shared/js/background/classes/tab-state.js Show resolved Hide resolved
@jonathanKingston jonathanKingston changed the title Jkt/refactor tab Refactor tab to serialize to storage Sep 9, 2022
@jonathanKingston jonathanKingston force-pushed the jkt/refactor-tab branch 2 times, most recently from 318d36b to fed8c7c Compare September 22, 2022 23:24
@jonathanKingston jonathanKingston merged commit 0fe1453 into develop Sep 27, 2022
@jonathanKingston jonathanKingston deleted the jkt/refactor-tab branch September 27, 2022 20:36
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.

None yet

2 participants