[VBLOCKS-6682] Clean up potential null records after process end#693
Open
mhuynh5757 wants to merge 3 commits into
Open
[VBLOCKS-6682] Clean up potential null records after process end#693mhuynh5757 wants to merge 3 commits into
mhuynh5757 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce Android-side NullPointerException crashes by cleaning up in-memory call invite/call record state when the app process/task ends (e.g., user swipes the app away or the OS kills the process), and by making disconnect/cancel flows tolerant of missing records.
Changes:
- Add
VoiceService.onTaskRemovedcleanup to reject active incoming invites when the task is removed. - Make
ACTION_CALL_DISCONNECTgracefully handle missing call records by clearing stale foreground notifications instead of crashing. - Adjust FCM invite/cancel handling to better tolerate already-cleaned-up records, and document the fixes in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
CHANGELOG.md |
Adds release notes describing the Android crash fixes and cleanup behavior. |
android/src/main/java/com/twiliovoicereactnative/VoiceService.java |
Adds task-removal cleanup and makes disconnect tolerant of missing call records. |
android/src/main/java/com/twiliovoicereactnative/VoiceFirebaseMessagingService.java |
Routes incoming invite handling through startService and makes cancelled-invite handling tolerate missing call records. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+37
to
+44
| // Route through startService so VoiceService enters the "started" state, | ||
| // which is what causes onTaskRemoved to fire when the user swipes the app away. | ||
| final Context context = VoiceApplicationProxy.getApplicationContext(); | ||
| context.startService(VoiceService.constructMessage( | ||
| context, | ||
| Constants.ACTION_INCOMING_CALL, | ||
| VoiceService.class, | ||
| callRecord.getUuid())); |
Comment on lines
+179
to
+182
| } catch (Exception e) { | ||
| logger.warning(e, "Failed to reject invite during task removal"); | ||
| removeNotification(callRecord.getNotificationId()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submission Checklist
CHANGELOG.mdto reflect any feature, bug fixes, or known issues made in the source codeFiles changedtab prior to submitting the pull request for review to ensure proper usage of the style guideDescription
This PR implements cleanup functions upon process end to reduce null pointer exceptions around in-memory and invalidated call records.
Breakdown
Validation
Additional Notes
N/A