Persist only one property of the state - enabledApps. The persistence uses the default storage engine - localStorage. There are a couple of other options https://github.com/rt2zz/redux-persist#storage-engines, including indexedDB, but for our needs the default one should be good enough.
Details
Run the web app, choose enabled apps and refresh the page - the selection should remain. Open debugger and check application tab -> local storage: there should be a single entry associated with localhost that contains an object with enabledApps and _persist keys.
To test if the state is cleared, I disabled calendar, logged out and in and checked if calendar is enabled - just like in defaultWebEnabledApps.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Looks good to me, adding @ashoat as blocking since I think he has additional context and this is a consequential change
One remaining part is handling cleaning the data when logging out - I created a task https://linear.app/comm/issue/ENG-1604/clean-enabled-apps-on-logout to handle it. We can also consider having a mechanism which clears the whole persisted state on logout.