-
Notifications
You must be signed in to change notification settings - Fork 20
feat: use metadata.comment as fallback for push notification description #432
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: master
Are you sure you want to change the base?
feat: use metadata.comment as fallback for push notification description #432
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughBoth Android and iOS notification services now use a fallback: if the primary description is empty or not a valid string, the code pulls description text from the notification's metadata comment field without changing public signatures or downstream formatting logic. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@assets/android/MessagingService.kt`:
- Around line 163-166: The description extraction sets descriptionText from
notification.optString("description", "") but doesn't handle JSONObject.NULL or
whitespace; change the logic around descriptionText (and the fallback from
notification.optJSONObject("metadata")?.optString("comment", "")) to treat
values that are null, the literal string "null", or blank (use isBlank()) as
empty and therefore trigger the fallback; ensure you check both the initial
optString result and the metadata comment result before assigning/using
descriptionText.
|
Sir review the changes please |
Description
This PR closes issue #424 by adding a fallback to
metadata.commentwhen the invoicedescription(memo) is empty in push notifications.Changes
🤖 Android
commentfrom themetadataobject if the primarydescriptionfield is empty.optJSONObject) to ensure stability.🍎 iOS
notificationDict[@"metadata"][@"comment"]ifdescriptionTextis missing.isKindOfClass:[NSDictionary class]) to prevent crashes with unexpected payloads.Rationale
Currently, push notifications for payments (sent/received/held) only display the amount if the invoice memo is empty, even if a payment comment exists. This change ensures that relevant context provided in the comment is visible to the user immediately. This behavior now matches the existing logic in the app's internal transaction history list (TransactionItem.tsx).
Verification
description->metadata.comment-> (none).metadatais missing.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.