-
Notifications
You must be signed in to change notification settings - Fork 143
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
NullPointerException in PresenceChannelImpl.java causing a crash #286
Comments
Hi @lordcodes - I'm investigating this, but I'm struggling to reproduce the issue. Also, would you mind telling me what version of the SDK you are using? |
Hi @jonathanlloyd. I raised a Pusher support ticket alongside the GitHub issue including various bits of information (22613). The crash happens when subscribing to the presence channel, therefore it is before we do anything with the channel. This means it doesn't matter what you actually do with the channel, crash happens before you even get to that. We are using the latest released version of the SDK (2.2.5). From the stack-trace, you can see that it crashes with an NPE when using the 'PresenceData' returned from Beyond this I guess, it is worth looking into how it is possible for a subscription message to be sent that doesn't deserialize properly into the PrescenceData. I appreciate it is hard to reproduce, it seems to happen for a subset of users in a subset of sessions. It is also worth saying if you reproduced it, you would just get a stack-trace that said the presence data was null and an NPE like I sent over. I do appreciate you would like to reproduce it though. |
We had similar issue. Source was - we used Android Studio alpha or beta d8 (ex proguard). As I understood - this new beta d8 removed or modified java bytecode, which cause this error. Rolling back to stable Android Studio completely solved this issue. |
I’ve always been using the latest stable Android Studio and Gradle plugin,
same on CI where our release builds are built. This crash happened to us in
production.
…On Tue, 23 Feb 2021 at 07:30, Rexee ***@***.***> wrote:
We had similar issue. Source was - we used Android Studio alpha or beta d8
(ex proguard). As I understood - this new beta d8 removed or modified java
bytecode, which cause this error. Rolling back to stable Android Studio
completely solved this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACWLLEYT6PVVFTRNVLXFHT3TANKQFANCNFSM4RGYYBWQ>
.
|
I'm just describing how this appear and how it's been solved. You can believe or not, but changing AS version solves issue. So I think it's some problem with proguard/d8 bytecode manipulations. |
Sorry, I wasn’t saying I don’t believe you. I was merely saying it’s sadly
not possible for me to just rollback to latest state AS as Im already using
it.
…On Tue, 23 Feb 2021 at 07:47, Rexee ***@***.***> wrote:
I’ve always been using the latest stable Android Studio and Gradle plugin,
same on CI where our release builds are built. This crash happened to us in
production.
… <#m_-6785542303537114051_>
On Tue, 23 Feb 2021 at 07:30, Rexee *@*.***> wrote: We had similar issue.
Source was - we used Android Studio alpha or beta d8 (ex proguard). As I
understood - this new beta d8 removed or modified java bytecode, which
cause this error. Rolling back to stable Android Studio completely solved
this issue. — You are receiving this because you were mentioned. Reply to
this email directly, view it on GitHub <#286 (comment)
<#286 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACWLLEYT6PVVFTRNVLXFHT3TANKQFANCNFSM4RGYYBWQ
.
I'm just describing how this appear and how it's been solved. You can
believe or not, but changing AS version solves issue. So I think it's some
problem with proguard/d8 bytecode manipulations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACWLLEYVBBAOMWDAHPREFXTTANMQBANCNFSM4RGYYBWQ>
.
|
@danielrbrowne Fantastic, thank you. Will update when the next release is out and re-enable our presence channel functionality. Does the fix suggest one of our other clients was sending malformed data on the presence channel or an edge-case where invalid data is received on the websocket? |
@lordcodes It remains unclear what was the exact cause of this malformed data (I got drafted in on this issue only recently, and I'm by trade an iOS engineer, so some of the context was missing), however this does look to have been a bit of an edge case. This is why this was previously left unhandled. I am working on a new 2.2.6 patch release ASAP. |
@danielrbrowne Thank you, I appreciate the reply. I could tell it is very much an edge case, however, somehow it was happening quite often for our users. The fix should allow us to put back the presence channel functionality which is great! |
@lordcodes v2.2.6 with this fix included, is now released! |
@danielrbrowne Fantastic, thanks. Will update and re-enable logic when I can. |
What is the issue?
A NullPointerException is occurring within the PresenceChannelImpl implementation when extracting presence data from a received message. This is causing our app to crash for quite a few users. I will need to somehow find a way to catch this error to avoid the app crashing in the short-term.
Is it a crash report? Submit stack traces or anything that you think would help
Here is the stack trace from our error reporting:
In
onMessage
when the message is a subscription success, it tries to extract the presence data from the event. This data seems to come back as null, but the code isn't handling that case and so a NullPointerException is thrown.PresenceChannelImpl.java
Any improvements you suggest
Only improvement is to not crash.
Let me know if you need more information, although not sure what else I can see, due to the whole stack-trace being entirely within Pusher code and being when subscription succeeds, as opposed to a message triggered by the app.
CC @pusher/mobile
The text was updated successfully, but these errors were encountered: