-
Notifications
You must be signed in to change notification settings - Fork 23
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
NullPointerExeption thrown whenever we archive a flag #278
Comments
Hi @pal-tgiannakopoulos, thank you for reporting this issue. Logging internally as SDK-573. We will investigate. |
@pal-tgiannakopoulos, do you have a count of occurrences from crash reporting tooling? What is that as an absolute number and as a percentage of prod customers? |
I did a preliminary investigation. I agree with your conclusion that a null flag key is ending up in that Are you using polling or streaming? If you haven't specified in the SDK config, the default is streaming. The SDK uses the flag key that is received from the server and we replace the local representation with a
|
hi @tanderson-ld The crashes we are getting are not a lot. Each time we have archived a flag we got around 30-40 crashes. We don't explicitly set polling or streaming, so I guess we use streaming As for the actual problem, I don't think your problem is with what the server is sending, but with what is stored when that happens. |
HI again @pal-tgiannakopoulos , I did some more testing with various combinations of init, identify, and archive at various stages and was unable to reproduce the issue. I also double checked the storage layer and it looks to be operating as expected. Below is serialized flag data for the flag I was testing with. Before archive:
After archive but before restart:
The next app launch, the deleted flag gets wiped out by the incoming payload which does not contain the flag at all. |
Do you by chance trigger any routines on flag updates being received? Another thought: I need to verify, but the flag is only marked as deleted client side in the SDK if the phone was connected and streamed the DELETE update that happens when the flag is archived. What do you think are the odds that ~30-40 customers are connected when the flag is archived and then choose to logout? 30/25k is 0.12% which would be the product of the |
hi @tanderson-ld, yes you are correct about the probabilities. This is my assumption as well, that's probably why we don't see hundreds or thousants of crashes. And yes I trigger updates on flag updates being received. I am exposing flags as Flows for my app to know about. These are typically collected from our viewModels. simplified relevant code:
Please note, while I am observing only flags my app knows and cares about, I have seen the crashes happening when archiving flags that are not relevant to the app, so I don't know how much the above logic would be responsible for triggering the crash. This method also does not appear in the crashlog. The crash on my code derives from another Flow collection where the LoginState is observed and the |
@tanderson-ld |
Just tried that too and still not able to reproduce the issue. Have you been able to reproduce it locally? |
No I haven't tried. |
I spent several hours yesterday to replicate this in a controlled environment and I couldn't, so sadly I cannot provide anything else other than the crashlogs in the issue description. |
Is this a support request?
No
Describe the bug
We are assuming that the following code inside ContextDataManager.java is causing a null element to end up in the
updatedFlagKeys
collections which is used as a parameter tonotifyFlagListeners
method.To reproduce
We haven't managed to reproduce this on demand but we are seeing this crash whenever we are archiving a flag.
In our app we allow logging out, which causes a call to identify with an anonymous context.
Our assumption based on user flow logs is that this action is causing the crash to happen probably after a flag is archived.
Expected behavior
To not crash
Logs
No other logs related other than the crashlog in the description
SDK version
Android SDK 5.3.0
Language version, developer tools
Kotlin 1.9.24
Android compile SDK version 34
Android target SDK version 34
Gradle plugin version 8.5.0
Gradle version 8.8
OS/platform
Android regardless of version
Our app runs from Android 8 to Android 14
All of them seem to have the same problem
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: