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

TranslationProvider: Fix crash on login, from non-null-FL invariant #5865

Merged
merged 1 commit into from
May 1, 2024

Conversation

chrisbobbe
Copy link
Contributor

Sentry is reminding us that we forgot to check if the active account has server data. Adding this check fixes a crash when zulipFeatureLevel is null because of not having server data right after login.

Sentry is reminding us that we forgot to check if the active account
has server data. Adding this check fixes a crash when
`zulipFeatureLevel` is null because of not having server data right
after login.
@chrisbobbe chrisbobbe added the severe: crash The app quits, or stops responding. label May 1, 2024
@chrisbobbe chrisbobbe requested a review from gnprice May 1, 2024 21:42
@gnprice
Copy link
Member

gnprice commented May 1, 2024

Thanks!

I was a bit surprised we don't have the feature level right after login — after all, we just learned it from the server settings. But reading getZulipFeatureLevel and following references, this comment (in getServerVersion) explains it:

  //   Oh, and there's one other case where an Account record will lack this
  //   data: immediately after login, before we complete the first initial
  //   fetch.  That's fixable, though: we already have the version from
  //   server_settings when we enter the login flow, so we just need to
  //   remember that value and stick it in the initial Account record.

In zulip-flutter, we already use that information to have a feature level from the beginning right after login. (OTOH we don't yet update it on register, as zulip-mobile does; that's zulip/zulip-flutter#458 .)


Anyway, this all LGTM — merging.

@gnprice gnprice merged commit 26be5cf into zulip:main May 1, 2024
1 check passed
@chrisbobbe chrisbobbe deleted the pr-fix-missing-fl-crash branch May 1, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severe: crash The app quits, or stops responding.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants