fix(android): Improve push notification loading reliability and add diagnostic logging#6711
fix(android): Improve push notification loading reliability and add diagnostic logging#6711diegolmello merged 13 commits intodevelopfrom
Conversation
- Added detailed logging for notification loading process in LoadNotification.java. - Implemented error handling for null or empty userId and userToken. - Enhanced retry logic for network requests with clear logging of attempts and failures. - Updated Ejson.java to include logging for token and userId retrieval. - Improved fallback notification handling in CustomPushNotification.java with additional logging for failures.
|
Caution Review failedThe pull request is closed. WalkthroughThese changes enhance Android push notification processing with improved robustness through comprehensive error handling, null checks, thread-safe initialization, and expanded diagnostic logging across notification lifecycle stages. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Android Build Available Rocket.Chat Experimental 4.65.0.107532 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNT_WZhhUi5TNV4tmGX1GR2QFqcHIvQXdxflAusqcJtIUJIV51K9uLFChkhR_6W5bnYKp535DUtnt0lmIRY_ |
ebf1e4d to
1063087
Compare
…ror handling - Added verbose logging for notification processing and avatar URI generation in CustomPushNotification.java. - Implemented checks for React initialization before processing notifications. - Updated Ejson.java to ensure avatar URI generation handles null or empty values gracefully. - Enhanced LoadNotification.java to log encryption fields in notifications. - Improved overall error management and notification handling logic.
1063087 to
733c21f
Compare
733c21f to
f2ef6db
Compare
|
iOS Build Available Rocket.Chat Experimental 4.66.0.107615 |
|
iOS Build Available Rocket.Chat Experimental 4.66.0.107619 |
|
Android Build Available Rocket.Chat Experimental 4.66.0.107618 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTceCDXLl0n5KzB7McYH_xPCE7vnmVY3fr0bo0WwW_fYcqILHUCkhPXNwvGE45prdAr8Xz_W_RnJOhUFfvO |
|
Android Build Available Rocket.Chat Experimental 4.66.0.107620 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNRfE-G-Ytsb5alGX8qbpjuuuaxJG396MHERdATYJodrY1VE3_9TkUs8OJpVe81zR3dSyCFHZ0SjxCHf0zhs |
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-onlypush notificationsVerifying logs (debug build):
adb logcat | grep RocketChatAffected 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.lengthtoRETRY_COUNT < TIMEOUT.length - 1Logging (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.
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.