fix(android): Improve push notification loading reliability and add diagnostic logging #6711
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.
Proposed changes
This PR fixes critical bugs in Android push notification handling that caused "message-id-only" notifications to display placeholder text ("You have a new message") instead of loading the actual message content.
The issue was difficult to reproduce and only affected certain users. Investigation revealed multiple bugs:
This PR also adds comprehensive production-safe diagnostic logging to help identify and resolve similar issues in the future.
Issue(s)
https://rocketchat.atlassian.net/browse/SUP-882
How to test or reproduce
Testing the fix:
message-id-only
push notificationsVerifying logs (debug build):
adb logcat | grep RocketChat
Affected screens:
Screenshots
N/A - This is a backend notification handling fix with no UI changes
Types of changes
Checklist
Further comments
Technical Details:
Bug Fixes (LoadNotification.java):
callback.call(null)
ensuring proper flow continuationRETRY_COUNT <= TIMEOUT.length
toRETRY_COUNT < TIMEOUT.length - 1
Logging (Production-Safe):
BuildConfig.DEBUG
(debug builds only)Files Changed:
LoadNotification.java
- Core bug fixes and error handlingCustomPushNotification.java
- Added flow loggingEjson.java
- Added debug-only verbose logging with BuildConfig guardsThe logging addition makes future issues like this much easier to diagnose while maintaining security and following industry standards for production logging.