Better storage
See #144 (closed)
What this does:
- 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 optioncollapseMessageWithSubject
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. - 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.
- 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 withoutconfig.json
which, in the future we'll change intoconfig.sample.json
- Another module was introduced -
interface
- this is mainly for stuff not directly related to anything and mostly for UI's internal housekeeping. CurrentlysetPageTitle
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. - Allows FE to work without
static/config.json
andapi/statusnet/config.json
, completely relying on built-in defaults. even without user settings - 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