Skip to content

Remove cross-tab syncing and persist only user state

Axel Bocciarelli requested to merge persistence into master

Fix #287 (closed)

  • Remove cross-tab syncing so people can open different investigations in different tabs.
  • Persist only the user state slice -- why:
    • to reduce the strain on localStorage;
    • to avoid hiding issues, like something not being refetched when it should (this was the case with Open Data -- see below);
    • because it doesn't actually serve any purpose since we refetch every investigation on every page load anyway.
  • Stop integrating Rest Hooks with Redux -- we don't use Redux' useSelector to retrieve Rest Hooks entities, so there's no point in doing this.
  • Fetch every investigation when App is first mounted (and when sessionId changes), instead of from doSignIn and from various components -- why:
    • so that investigations are not refetched every time we visit the "My Data" page, for instance;
    • because doSignIn is not called if the user is already logged in (this is why "Open Data" investigations weren't always being refetched on initial page load).

The next step will be to fetch investigations only when needed instead of all of them at once on initial page load. This will require back-end work.

Edited by Axel Bocciarelli

Merge request reports