-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(android): Improve push notification loading reliability and add diagnostic logging #6711
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
base: develop
Are you sure you want to change the base?
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
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_ |
OtavioStasiak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
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 |
…yBroadcast - Added validation for notification ID in CustomPushNotification to ensure it is present and correctly formatted before processing. - Improved error handling in ReplyBroadcast for invalid notification IDs during message replies. - Enhanced logging for invalid notification ID scenarios to aid in debugging.
- Added try-catch blocks around notification handling to log errors during processing. - Removed redundant validation comments and ensured notification ID is parsed safely. - Improved logging for failures in notification processing to enhance debugging capabilities.
…and Ejson - Added synchronization to ensure thread safety when creating notification properties in CustomPushNotification. - Enhanced error handling for null NotificationManager during channel creation and added logging for better debugging. - Made ensureMMKVInitialized method synchronized in Ejson to prevent concurrent access issues.
f2ef6db to
24282ae
Compare
|
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.