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.
Merge request reports
Activity
Why did you move the russian i18n file in this MR? Shouldn’t it be already done in !337 (merged) ?
Edited by Haelwennyeah, 9f84f4ea should not be in this MR.
mentioned in merge request !346 (closed)
added 13 commits
-
c09dcd9c...7887e42f - 6 commits from branch
develop
- f1c16327 - Initial version
- 2db991fc - some recategorization of options...
- 82fa5d08 - more refactoring
- 580aae1b - Added more stuff that's actually being added to instanceConfig, simplified the whitelist.
- 1245d791 - translations
- 136add8a - fix some missing stuff
- 39415338 - more missing stuff
Toggle commit list-
c09dcd9c...7887e42f - 6 commits from branch
added 1 commit
- 40a17538 - Removed warning. Added support for working without static/config.json
ok i wanted to change the way storage is saved - instead of having a whitelist of mutations that trigger saving actually triggering it programmatically by emitting some event but that would've involved either an empty mutation or rewriting persistent storage entirely and i don't want to do that yet.
Yes in the end there are two whitelists now instead of one, but one of the whitelists is much shorter now and other one doesn't really need to be touched that often so i think in the end it does resolve issues with "oh shit this setting doesn't save" and "oh shit this setting gets overwritten by instance's config"
On top of that, getting rid of throttling allows debugging these issues much better.
mentioned in issue pleroma#278 (closed)
added 1 commit
- a61ad054 - small thing to display instance-provided default