fix: init Amplituda lib causing NullPointerException on some devices [WPB-17405] #4020
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a NullPointerException occurring during the initialization of the Amplituda library by introducing safe calls and exception handling, as well as upgrading the library version. Key changes include:
- Upgrading the Amplituda library version from 2.2.2 to 2.3.0 in the Gradle configuration.
- Propagating nullability for the wave mask through AudioMessageType, RecordAudioMessagePlayer, AudioWavesMaskHelper, and AudioState.
- Implementing lazy initialization for Amplituda with exception handling to bypass initialization failures.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Updated Amplituda version to 2.3.0 |
| AudioMessageType.kt | Made waveMask nullable and ensured a default mask is applied |
| RecordAudioMessagePlayer.kt | Emitted wave mask only if available via a safe call |
| AudioWavesMaskHelper.kt | Wrapped Amplituda injection in Lazy and added null-safe processing |
| AudioState.kt | Updated wavesMask field to be nullable and adjusted default |
| AppModule.kt | Updated Amplituda import to the new package path |
app/src/main/kotlin/com/wire/android/media/audiomessage/AudioWavesMaskHelper.kt
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4020 +/- ##
===========================================
- Coverage 46.01% 45.99% -0.02%
===========================================
Files 520 520
Lines 18120 18127 +7
Branches 3046 3053 +7
===========================================
Hits 8338 8338
- Misses 8917 8924 +7
Partials 865 865
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
|
Built wire-android-staging-compat-pr-4020.apk is available for download |
|
Built wire-android-dev-debug-pr-4020.apk is available for download |



PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Issues
some devices in the play store are crashing with NullPointerException on Amplituda lib init
was unable to repro but try catching the init and handling this case by not generating an audio wave should take care of it
Solutions
try catch
Needs releases with:
Testing
Test Coverage (Optional)
How to Test
Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.
Notes (Optional)
Specify here any other facts that you think are important for this issue.
Attachments (Optional)
Attachments like images, videos, etc. (drag and drop in the text box)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.