[web] Tab sync redux actions
Summary:
ENG-6660 : Broadcast redux actions
Because only one tab will handle tunnelbroker messages (and we won't have a mechanism like updatesCurrentAsOf for keyserver communication) we need to share the changes with the other tabs. This diffs adds a new redux middleware that send select redux actions to the other tabs, where they are applied.
- Only the tab broadcasting the action will persist the data to the SQLite, other tabs will skip this
- Deciding if an action will be synced (and persisted to SQLite) depends on a new dispatchSource field
- The keyserver actions will continue to work as they currently do
Depends on D11123
Test Plan:
- Add +dispatchSource?: DispatchSource field to UPDATE_DRAFT action
- Add dispatchSource: 'tunnelbroker' to call to dispatch for drafts
- Open multiple tabs
- Make sure that if drafts are modified in one tab, this is reflected in all other tabs
- Make sure that there is only one db operation dispatched (only one tab should dispatch operations)
- Make sure that if a new tab is loaded it has the current drafts
Reviewers: kamil, inka, bartek
Reviewed By: kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11132