-
-
Notifications
You must be signed in to change notification settings - Fork 186
fix crash in JSONRPC #3756
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
fix crash in JSONRPC #3756
Conversation
the fix could have been avoid by checking for null or not being overly specific with the exception. as this is a very sensible area, where any failure is dramatic, we do both.
|
To test the changes in this pull request, install this apk: |
hpk42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
|
While developing chatmail/core#6818, I had a bug with the same symptom: DC crashed on startup with exactly this error message. The problem turned out to be:
If you can reproduce the problem and can install a re-compiled DC Android, I recommend replacing all calls to About this PR: If the problem you had is similar to the problem I had, then this PR would not have made anything better. Instead of crashing on startup, DC would just hang forever on startup. I'm afraid there is not a lot the UI can do when What core could do is, make |
|
I need to think a bit about general ways to improve this, maybe I'll come up with something. |
then i assume, you have another issue. the PR actually solves the issue at hand, things are working again as expected. here was also nothing super-fancy on that account, so i assume, it can happen also in other cases |
|
Ok, that's great. As commented on the code, we need to log a warning / error when we ignore a null Still, there is some root underlying problem which led to |
this is a bit bad, this didn't "solved the problem", in the end we don't even know now what the problem was, instead of just ignoring it and losing the opportunity to debug it and fix the actual problem it would be better to know why core returned null in this case, this shouldn't happen to start with if I got it right, and as @Hocuri said in other similar bugs where core would return null we then would just ignore the problem and potentially it can be a problem you can't just ignore :( |
|
"better crash, the user will report and we will fix" is nice in theory, but unfortunately also comes with "we do not care if the user's device is unusable for weeks" ;) i could not make more sense out of the error, though these were mostly perfect debugging conditions, which are usually not the case i agree that in many flows it is better to crash, eg. if there is a concrete user action the user can not do as a workaround. but for such basic things, it just makes everything unusable. there may be tons of reasons for a bad value, including some temporary memory flaw ... we had that discussion often, i do not think, it makes much sense to warm that up again. additional logging as @Hocuri suggested makes sense, though |
|
(Meant it in this particular case that you had access to the device) |
|
@r10s in any case, could you try to find out the root cause of this particular problem? You can try replacing all calls to |
|
yeah, but i could not make more sense of that even then. what could we expect from a random user? |
adbenitez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides not silently ignoring null without logging, LGTM
|
@adbenitez @Hocuri i added a commit to log the error case. if there are more things, please add to this PR, otherwise please merge; i am not really on android atm |
the fix could have been avoid by checking for null or not being overly specific with the exception.
as this is a very sensible area,
where any failure is dramatic,
we do both.
as said, this error pops up on monikas device,
unclear if related to an app update (she is on 1.58.2) or by some message.
did not test yet, still trying to get this patch on the phoneEDIT: tested, it fixes the issue at hand