insightsengineering / teal

Exploratory Web Apps for Analyzing Clinical Trial Data
https://insightsengineering.github.io/teal/
Other
168 stars 33 forks source link

Solve disk space consumption by bookmarks #1188

Open chlebowa opened 3 months ago

chlebowa commented 3 months ago

Companion to https://github.com/insightsengineering/teal/pull/1011

teal bookmarks are duped to files stored on the server (literature).

The state itself is negligibly small (a few kilobytes) but report cards can run into dozens of megabytes.

Find and implement solution. Note that blindly deleting existing bookmarks is possible but not functional as they may be in use.

chlebowa commented 3 months ago

Minutes of discussion 28 March 2024

  1. The fact that report bookmarks are so large may be due not solely to the content but also additional code required to deserialize R6 objects. Perhaps isolating contents from report cards could decrease the size. This would perhaps require heavy intervention in teal.reporter.
  2. We should find out how much disk space is actually allotted to a deployed app.
  3. Tracking bookmark use is possible. onRestore(d) callbacks can save metadata to a file in the bookmark directory.
  4. Discussed ways of removing bookmarks: a) onBookmark, check when bookmarks were last accessed (file.info) and delete ones that haven't been used b) allow user to name the bookmark directory and have them directly communicate with app dev regarding keeping and removing bookmarks c) create module that reads list of bookmarks from disk and allows user to remove them; run this module only for specific users (session$user?) d) allow user to add expiration time when creating bookmark