Repository navigation
Read Pay button reports and actions at press time - #108230
luacmartins merged 4 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR adds a new |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Reviewing... |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8b99ab4a3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const filteredReportActions = getAllPolicyExpenseChatReportActions(allReports, allReportActions); | ||
| if (iouReport && isIOUReport(iouReport)) { | ||
| // eslint-disable-next-line rulesdir/no-onyx-get-snapshot-key -- deliberately live, not the Search snapshot the old useOnyx read on Search chat previews: moving the IOU report writes optimistic data to live keys, so reports and report actions must be live to find the workspace chat | ||
| const [allReports, allReportActions] = await Onyx.multiGet([ONYXKEYS.COLLECTION.REPORT, ONYXKEYS.COLLECTION.REPORT_ACTIONS]); |
There was a problem hiding this comment.
When someone verifies their account after choosing a workspace for a personal IOU, the verification effect can resume the payment here. Can we keep the workspace chat data on a scoped subscription for that path?
There was a problem hiding this comment.
Right, the verify-account resume calls it from an effect. Fixed in 65ea87b: the wall now subscribes through useSubmitterWorkspaceChatActions, which selects only the submitter's workspace chats and their actions, and only on IOU walls. It uses snapshot-aware useOnyx, so on Search it reads what main read.
Re-checked with real Pusher events: per update, renders per update stay at the same level as the previous head, so the scoped subscriptions don't bring back the renders this PR removed.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safariweb_chrome.mp4web_chrome_2.mp4 |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for addressing the comments
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.57-0 🚀
|
|
No help site update needed — this PR optimizes existing payment flows without adding a feature, changing UI labels or steps, removing a beta gate, or making existing article guidance incorrect. |
Explanation of Change
Pay buttons on Search and the payment wall (KYCWall) inside every Pay button subscribed to every report and report action, so any unrelated write re-rendered every Pay button on screen. They used this data only when Pay is pressed, so now they read it then. The archived check reads just the chat's name-value pair with
useReportIsArchived.The press-time reads are live. On to-do lists they already were; on other Searches they came from the snapshot, but the payment writes its optimistic data to live keys, so live is what it needs.
Web, Ready to pay with 12 rows, unrelated write: renders 609 to 273 (-55%), JS work about -22%. The Search row part is web only, since mobile rows have no Pay button.
Fixed Issues
$ #108484
PROPOSAL:
Tests
type:expense-report status:approved, pay another report with Mark as paid, and verify its row and report preview show it as paidOffline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari