dativebase/dativerf

Problem: login does not trigger a fetch of oft-used initial data

Closed this issue · 0 comments

When the current production Dative succeeds in logging in a user, it makes several requests to the OLD instance for data needed for basic functionality. This includes the first page of forms, the last page, the data to create a new form, and the data needed to perform a fresh search across forms. DativeRF should make similar requests and cache the results in memory (in the re-frame db).

A/C:

  • Add functionality to DativeRF such that, upon successful login, we populate the db with (appropriately namespaced) keys whose attributes are maps/vectors containing the return values from the following requests:
    • GET oldname/applicationsettings
    • GET oldname/forms/new
    • GET oldname/formsearches/new
    • GET oldname/formsearches/forms?page=1&items_per_page=10
    • GET oldname/formsearches/forms?page=N&items_per_page=10
  • The values returned by the above requests should probably be stored under a top-level key of db that is the ID of the currently authenticated OLD. E.g., (get-in db [:old-data :blaold :application-settings]), etc.
  • Upon successful logout, we MAY wish to purge the data stored in memory. However, I'm not sure about this. It might be a good idea to keep some of it cached, so that users who switch often between different OLDs can have faster startup times.