Skip to content

Conversation

@mubarak-mustopha
Copy link

What does this PR do and why?

This PR fixes #1600 .
The application crashes at startup when initializing a Model object. The code tries to read some user settings directly from initial_data, which contains the payload returned by the Zulip API POST /register endpoint.

In Zulip 12.0 (feature level 439), many of these settings were removed from the top level object into the user_settings dict.

This PR updates the code to retrieve user settings from the user_settings object when it is present in initial_data.

The tests were also updated to include all required user settings under the user_settings key when it is present in initial_data.

External discussion & connections

  • Discussed in #zulip-terminal in crashes after trying to start for the first time
  • [x ] Fully fixes #
  • Partially fixes issue #
  • Builds upon previous unmerged work in PR #
  • Is a follow-up to work in PR #
  • Requires merge of PR #
  • Merge will enable work on #

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

@zulipbot zulipbot added size: S [Automatic label added by zulipbot] bug: crash labels Dec 18, 2025
Retrieve user settings from the `user_settings` object when it is
present in `initial_data`.

Many of these settings were removed from the top level object returned
by `POST /register` in ZFL 439 (v12.0).

Tests updated.
Fixes zulip#1600.
@mubarak-mustopha mubarak-mustopha force-pushed the fix/user_settings_keyerror branch from f8966b0 to a2a952c Compare December 18, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: crash size: S [Automatic label added by zulipbot]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash at fresh start with KeyError on twenty_four_hour_time

2 participants