Skip to content

Store server's version number, include in Sentry events #3745

@gnprice

Description

@gnprice

When an error happens only on certain versions of the Zulip server, that can be a powerful clue for diagnosing it. I've often noticed when looking at Sentry events that I'd like to have that information. #3732 is a recent example that brought this to mind.

In implementing this, one layer is to use the Sentry API to get that information attached. I'm not sure how best to do that; @ray-kraesig has studied those docs recently and may have ideas.

The other layer is to get and keep the server-version information around in the first place. The server reports its version number in the server_settings response, but we don't currently store it anywhere; the only things we use the server_settings response for are at initial login, so we fetch it once then. It wouldn't do to just store it then, either, because of course the version (and other parts of that response) can change over the months and years the user might stay logged in.

Here's a plausible approach:

  • Add a property like serverVersion to the Account type, found in the accounts state-subtree. Can be null | string.
  • In the login flow, save the version we get.
  • At the same time we call /register aka registerForEvents, in doInitialFetch in fetchActions.js, make a /server_settings request again and save the new version value.

The server version number could also be useful if we decide to condition on it for certain API changes, as suggested at #3732 (comment) .

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions