Repository navigation
Support transaction push notifications - #59308
Conversation
|
@neil-marcellini Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Looks pretty good to me, but I don't understand how transaction push notifications will be tested, so I'm requesting changes. We should test that selecting a transaction notification navigates you to the expense report as described in the explanation of changes.
I understand backend changes are needed but we should still be able to manually test that on dev right? (edit: see comment below)
| PushNotification.onReceived(PushNotification.TYPE.TRANSACTION, applyOnyxData); | ||
| PushNotification.onSelected(PushNotification.TYPE.TRANSACTION, navigateToReport); |
There was a problem hiding this comment.
NAB: We don't have to refactor or fix this now but it's kind of weird that we do the same thing for all of these different types.
There was a problem hiding this comment.
Agreed. I'm working on removing the moneyRequest type since it's redundant. Handling transactions will also change a bit to handle some edge cases. I'm just handling the simple case for now though.
| Navigation.goBack(); | ||
| } | ||
|
|
||
| Log.info('[PushNotification] onSelected() - Navigation is ready. Navigating...', false, {reportID, reportActionID}); |
There was a problem hiding this comment.
NAB: You're sure the reportActionID isn't useful in the logs?
There was a problem hiding this comment.
Yeah since we're just navigating to the report, it's not really important here.
neil-marcellini
left a comment
There was a problem hiding this comment.
Oh sorry I see, this has to go out before the backend changes. All good then.
This comment was marked as outdated.
This comment was marked as outdated.
|
Code looks good and tests well on Android, but I can't do the test on iOS for now Screen.Recording.2025-04-03.at.13.53.42.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-03.at.13.53.42.movAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@arosiclair @neil-marcellini I think we're good to merge now, for the iOS video, the evidence of @arosiclair is good. |
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.1.23-1 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.23-7 🚀
|
| }; | ||
|
|
||
| type TransactionPushNotificationData = BasePushNotificationData & { | ||
| transactionID: number; |
There was a problem hiding this comment.
@arosiclair Just so you know, this needs to be a string because the length of the transaction ID exceeds the maximum value for number and gets rounded. I will update this type for EU/UK Expensify Cards soon, but you can do so as a follow-up if you wish.
There was a problem hiding this comment.
I think we would have to update the data type in the backend as well. We're still parsing the value as an int here.
There was a problem hiding this comment.
Unfortunately, I don't have access to that repository. However, transaction IDs are stored as strings throughout the app on the frontend and optimistic data is built with that pattern as well. If the backend language can store such a large number, I believe that reading the integer as a string in JavaScript shouldn't be a problem and is done already.
There was a problem hiding this comment.
I believe we just parse this data from a JSON string into an object, so if the number is indeed too large, it would get parsed incorrectly. We can switch it to a string, we just need to do so on both the frontend and the backend. Do we have an issue for this?
There was a problem hiding this comment.
Yeah, the JSON makes sense. I don't think there is an issue created. I see that the transaction ID isn't even used in the current push notification logic (defined only as a type), so it's something that will be needed later in the EU/UK project logic. There's no rush with this one. I just wanted to make a note of it here.
Explanation of Change
Adds support for
transactionpush notifications. These will be sent for various transaction related events like violations and e-receipts. Selecting the notification will navigate to the expense report.Fixed Issues
Part of #58307
Tests
Note: transaction notifications will be tested when the backend PR is deployed
Offline tests
None
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
screen-20250401-181719.mp4
iOS: Native
ScreenRecording_04-01-2025.18-05-32_1.mov