Skip to content
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: prevents NPE on null key material on android #288

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

cameronvoell
Copy link
Contributor

NPE was showing up in the following tests when clicking run unit tests on main branch

  1. Can send read receipts
  2. can Manage Preferences
  3. register and use custom content types
  4. register and use custom content types when preparing message
  5. returns keyMaterial for conversations

NPE was traced to key material sometimes being null during conversation create on Android.

If you re-click "run" for the test, it would usually pass on second run through.

Though it is strange that re-running the test make key material not null, we want to deal with the null key material gracefully since it is of type ByteArray? in xmtp-android => https://github.com/xmtp/xmtp-android/blob/5da219acc9c14c46fc35020e7a445725b28f5ce5/library/src/main/java/org/xmtp/android/library/Conversation.kt#L82

This PR also adds logging so we can note when keyMaterial is null on Android, so we can troubleshoot why it is null going forward.

@cameronvoell cameronvoell marked this pull request as ready for review February 26, 2024 15:42
@cameronvoell cameronvoell requested a review from a team as a code owner February 26, 2024 15:42
@cameronvoell cameronvoell merged commit c12f56f into main Feb 27, 2024
4 of 5 checks passed
@cameronvoell cameronvoell deleted the cv/fix-npe-null-key-material-android branch February 27, 2024 21:18
Copy link
Contributor

🎉 This PR is included in version 1.27.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

🎉 This PR is included in version 1.28.0-beta.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants