-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Opening a notification for nonexistent user/stream causes crash #4309
Comments
A correction: this bug can be triggered on v27.157 by interacting with this remaining piece of #2295 (quoting my description at #2295 (comment) ):
So if you've been using one realm/org; and you get a notification for a different one; and you have multiple known accounts in that other realm; then we don't switch to it, we stay in the wrong realm/org, and so we end up exercising this bug and crashing. |
I believe this is now fixed for PMs, by commits bed2f2a and e9941c0 (PRs #4335 and #4346). If we don't have data on one of the participants in the PM conversation, I haven't tested that empirically, though. Still open for notifications for stream messages -- we'll attempt to navigate to the given conversation, and if we can't find the stream (by name), then I expect that will crash. Before we close this issue, we should also have a comment in the code saying it's important that it checks for the users existing. As it stands, that check for PMs is basically a side effect of the fact that our |
I've just posted a few questions on CZO. |
Looking in Sentry, this isn't something that's happening to lots of users. But it is pretty bad when it happens, so would still be good to fix. And I think with the plan at the end of the issue description above, it won't be very complicated to fix. |
I think progress doesn't have to block on reading and understanding this thread. |
Is this this issue in Sentry? If so, it's happening pretty often. I did find a interesting example — a selfhosted realm, where the URL So, that sort of makes sense as an explanation for this. The server got moved, but we didn't update Another thing I see is where the URL in Here's an odd case where |
We had a steady stream of errors in Sentry caused by differences between the `known_urls` and `realm_uri`, where one of those had an extra `/` on the end (or some more surprising junk, such as a `/join/` link). Since we don't support running Zulip on a non-root path [1], we can simply compare the domain instead of the href. This is probably more of a band-aid than a real fix (we should figure out how the strange values get into `known_urls` and fix that), but we might as well just check the domain, since the path doesn't matter. Related: zulip#4309. [1] https://chat.zulip.org/#narrow/stream/3-backend/topic/support.20for.20running.20on.20non-webroot.20url.3F
We had a steady stream of errors in Sentry caused by differences between the `known_urls` and `realm_uri`, where one of those had an extra `/` on the end (or some more surprising junk, such as a `/join/` link) [1]. Since we don't support running Zulip on a non-root path [2], we can simply compare the domain instead of the href. This is probably more of a band-aid than a real fix (we should figure out how the strange values get into `known_urls` and fix that), but we might as well just check the domain, since the path doesn't matter. Related: zulip#4309. [1] zulip#4309 (comment) [2] https://chat.zulip.org/#narrow/stream/3-backend/topic/support.20for.20running.20on.20non-webroot.20url.3F
We had a steady stream of errors in Sentry caused by differences between the `known_urls` and `realm_uri`, where one of those had an extra `/` on the end (or some more surprising junk, such as a `/join/` link) [1]. Since we don't support running Zulip on a non-root path [2], we can simply compare the domain instead of the href. This is probably more of a band-aid than a real fix (we should figure out how the strange values get into `known_urls` and fix that), but we might as well just check the domain, since the path doesn't matter. Related: zulip#4309. [1] zulip#4309 (comment) [2] https://chat.zulip.org/#narrow/stream/3-backend/topic/support.20for.20running.20on.20non-webroot.20url.3F
We had a steady stream of errors in Sentry caused by differences between the `known_urls` and `realm_uri`, where one of those had an extra `/` on the end (or some more surprising junk, such as a `/join/` link) [1]. Since we don't support running Zulip on a non-root path [2], we can simply compare the domain instead of the href. This is probably more of a band-aid than a real fix (we should figure out how the strange values get into `known_urls` and fix that), but we might as well just check the domain, since the path doesn't matter. Related: #4309. [1] #4309 (comment) [2] https://chat.zulip.org/#narrow/stream/3-backend/topic/support.20for.20running.20on.20non-webroot.20url.3F
This is a situation that's only possible in the first place when caused by some bug in either the app or the server. But such bugs happen, and particularly because it involves the server, we should be robust enough not to crash on it.
I don't think there's a known way to trigger this with a current version from master (or with today's release v27.157, now in alpha) and a stock server. But one way to trigger it is by reproducing #4290 on the current production release, v27.156. As described at #4290 (comment) , the app crashes, and (on Android)
adb logcat
shows output like this:That is, we try to navigate to the right conversation as if it were on the active account... and when there isn't a user by that email, we crash.
Instead, we should handle this in
getNarrowFromNotificationData
-- that's the place where we take the raw names/IDs the server put in the notification and turn them into values we'll pass around to the "soft center" of our normal app code which assumes the data it gets is well-formed.In
getNarrowFromNotificationData
, we should confirm that the specified user(s) or stream exist in our data. If they don't, then treat it much like we do ingetAccountFromNotificationData
:That way the app will be open and running, and not crashed.
The text was updated successfully, but these errors were encountered: