Skip to content

Pleroma-tan apologizing for all the changes

HJ requested to merge been-awhile into develop

Displays cute art with some text when user logs in into updated FE.

Whether update has been seen or not determined by updateCounter flag which is stored in new flagStorage in server-side settings store (pleroma.settings_store). If user account creation date is after 04-08-2022 update is not shown as flag is automatically set to 1. "Never shown again" is likewise stored as a flag (for now). PleromaFE will automatically sync flags across sessions on login (when calling verify_credentials i.e. on page load) and update them immediately if changes are pending.

Flags will always choose the bigger number (i.e. if session a has flag1: 1, flag2: 0 and session b has flag1: 0, flag2: 1 the merge operation will result in both flags set to 1), there is a reset mechanism built in - if reset flag is set to positive number below 9000 it will reset ALL flags to 0. Special numbers exist - reset 1000 will trim flags to only known to the running FE, and 1001 will also reset them) so you can curl a setting with reset: 1 to clear the flags. It's purely for development/debugging purposes, there's no way to reset flags in the UI.

There's also hotpatch migrations possibility left in code - if version is bigger than what's expected it will look for window._PLEROMA_HOTPATCH.reverseMigrations function and call it with arguments 'serverSideStorage', { from: cache._version, to: VERSION }, cache and return of that function will be set to local cache of settings store. This is made so that if we (or admins) for whatever reason need to downgrade pleromafe version and newer version is incompatible with previous one admins can just install a hot patch that defines that function that does reverse migration.

To reset the flags you need to curl the flag-cleaning flag-command:

curl 'https://domain.tld/api/v1/accounts/update_credentials' \
  -X 'PATCH' \
  -H 'Authorization: Bearer beerseekseeklest' \
  --data-raw '{"pleroma_settings_store":{"pleroma-fe":{"_timestamp":123456,"_version":1,"flagStorage":{"updateCounter":0,"dontShowUpdateNotifs":0, "reset": 1}}}}' \
  --compressed
header desktop/tablet mobile
peek localhost_8080_notice_AMBz5N0xD2FZWvZVeS_iPad_Air_ localhost_8080_main_friends_Pixel_5_
full localhost_8080_notice_AMBz5N0xD2FZWvZVeS_iPad_Air___1_ localhost_8080_main_friends_Pixel_5___1_

TODO

  • make sure that migration function runs with empty this
  • finalize and fix text, add relevant links to gitlab and changelog
  • add credit for the art
  • check how anon viewer works
  • opt-out for admins
  • fix animation of text
Edited by HJ

Merge request reports

Loading