Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute the user_settings object transition #1108

Open
timabbott opened this issue Aug 1, 2021 · 1 comment
Open

Execute the user_settings object transition #1108

timabbott opened this issue Aug 1, 2021 · 1 comment
Labels
api migrations further discussion required Discuss this on #zulip-terminal on chat.zulip.org high priority should be done as soon as possible

Comments

@timabbott
Copy link
Member

In #19404, we just added the feature level 89 migration to change how we encode user settings in the Zulip API to use a user_settings object.

The API documentation should explain the transition clearly. Here's the recommended strategy:

  • Clients can immediately switch from processing the update_display_settings and update_global_notifications event types and process the user_settings event type instead.
  • Clients may then want to refactor how they store user settings to have a common module/object.
    The web app did this migration in zulip/zulip@998d710.
  • Clients can then pass the user_settings_object client capability to all Zulip server versions (older servers will ignore it). If the server returns a user_settings object in the register response, the client should use that to initialize its user_settings object using the user_settings portion of the response; otherwise it should use the user personal settings flags that appear in the top-level response.
@timabbott timabbott added high priority should be done as soon as possible api migrations labels Aug 1, 2021
@neiljp
Copy link
Collaborator

neiljp commented Mar 14, 2022

I just came across this in looking at #1163 (#1136). In that PR there is no migration, just an addition of user_settings for initial fetch and events for the new setting, which appears to be only in the user_settings object and absent in the top-level response - without using the capability option.

Is the idea that newer settings will be in user_settings by default, and using the capability will do a migration/merge of settings automatically into one dict/object for servers understanding that capability?

Support of multiple (ie. older) server versions is not completely clear from the current docs. The notes above seem to assume that the migration can occur immediately, perhaps neglecting support of older servers? (I'm not sure how switching processing different events could span server versions, for example)

To clarify my thoughts on how to proceed while supporting old servers:

  • request all 3 events (ie. add user_settings for new features)
  • request all 3 types in initial fetch (ie. add user_settings for new features)
  • handle each set individually initially (ie. look for new features in user_settings)
  • potentially merge all user settings into one location
  • add the client capability and migrate towards a situation where source data can be detected in original and new locations
  • eventually drop old fetch/event events and don't look in old locations for data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api migrations further discussion required Discuss this on #zulip-terminal on chat.zulip.org high priority should be done as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants