Skip to content

Better storage

HJ requested to merge betterStorage into develop

See #144 (closed)

What this does:

  1. Separates instance-related options (static/config.json, api-provided config, nodeinfo) into a separate module called instance. This cleans up a bit of confusion between user settings and instance settings, in this case it handles option collapseMessageWithSubject more gracefully, without temporarily renaming property name. This leaves more freedom for more options that admins may set for instance by default but user may change it nonetheless. Also leaves ground to separate instance options and backend features, however it's kinda messy right now so i did not dig into it.
  2. Removes 60s throttle. Currently nearly every action triggers persistent storage to store data into localstorage, the previous solution was to use throttle, but that causes the awkward "do not refresh page after changes or they will become lost". Removing it doesn't seem to harm the performance, but just in case I've added a whitelist of what actions do trigger persistent storage saving. Maybe i'll rework it into a one action that does trigger saving and use that in all that need saving.
  3. The newly introduced instance module also tries to keep all fields that are eventually get written into it to maintain some defaults, so it would also work without config.json which, in the future we'll change into config.sample.json
  4. Another module was introduced - interface - this is mainly for stuff not directly related to anything and mostly for UI's internal housekeeping. Currently setPageTitle is moved there and also stuff for giving feedback on whether settings were saved or not. I also wanted to move i18n stuff there but honestly couldn't figure out how to actually do that.
  5. Allows FE to work without static/config.json and api/statusnet/config.json, completely relying on built-in defaults. even without user settings
  6. Fixes some small things like mystical error when user isn't logged in and trying to fetch a friends timeline.

I'm currently testing it on SGSGB to see how it works.

Edited by HJ

Merge request reports