fix: Scan - Image can be dropped on scan zone in room when there are 2 members which leads to error.#68084
Conversation
…2 members which leads to error. Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Facing an issue on desktop app, will try to fix it in this PR but it doesn't seem related. Monosnap.screencast.2025-08-08.18-26-11.mp4 |
|
@rushatgabhane 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] |
|
Reached out here to find a new C+ to take over |
|
Thank you for spinning up a PR @Krishna2323. Give me some time to read the issue context first. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-08-29.at.20.51.12.android.movAndroid: mWeb ChromeScreen.Recording.2025-08-29.at.20.44.48.android.chrome.moviOS: HybridAppScreen.Recording.2025-08-29.at.21.02.25.ios.moviOS: mWeb SafariScreen.Recording.2025-08-29.at.21.03.34.movMacOS: Chrome / SafariScreen.Recording.2025-09-10.at.05.18.04.movMacOS: DesktopScreen.Recording.2025-09-10.at.05.20.27.mov |
| const preferredOrder: IOUType[] = [CONST.IOU.TYPE.TRACK, CONST.IOU.TYPE.SUBMIT, CONST.IOU.TYPE.SPLIT]; | ||
| return preferredOrder.find((type) => iouOptions.includes(type) && (type !== 'track' || isSelfDM(report))); |
There was a problem hiding this comment.
| const preferredOrder: IOUType[] = [CONST.IOU.TYPE.TRACK, CONST.IOU.TYPE.SUBMIT, CONST.IOU.TYPE.SPLIT]; | |
| return preferredOrder.find((type) => iouOptions.includes(type) && (type !== 'track' || isSelfDM(report))); | |
| if (isSelfDM(report) && iouOptions.includes(CONST.IOU.TYPE.TRACK)) { | |
| return CONST.IOU.TYPE.TRACK; | |
| } | |
| const preferredOrder: IOUType[] = [CONST.IOU.TYPE.SUBMIT, CONST.IOU.TYPE.SPLIT]; | |
| return preferredOrder.find((type) => iouOptions.includes(type)); |
I think it would be simpler. Beside that, can you add a test for this new util?
There was a problem hiding this comment.
Updated and added a util test.
|
|
||
| const hasReceipt = useMemo(() => hasReceiptTransactionUtils(transaction), [transaction]); | ||
|
|
||
| const scannableOption = getPreferredScannableIOUType(temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs, isReportArchived), report); |
There was a problem hiding this comment.
| const scannableOption = getPreferredScannableIOUType(temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs, isReportArchived), report); | |
| const scannableIouType = getPreferredScannableIOUType(temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs, isReportArchived), report); |
Besides that, should we add useMemo for this?
There was a problem hiding this comment.
Yes, I think it's a good idea. Updated.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@Krishna2323 can you elaborate what are differents between step 6-9 and step 11-14 |
|
Besides that, can you also add a note that those tests are only for Web/Desktop? |
The steps are same but one is performed in a room chat and the other one in a group chat. |
|
^ @koko57 is correct |
|
@Krishna2323 looks like we should disable scan zone in group dm or room |
Cool, thanks for confirming both!
Yes, we should do this. |
|
I'll update this PR today. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@hoangzinh updated: Monosnap.screencast.2025-09-06.12-54-44.mp4 |
| CONST.IOU.OPTIMISTIC_TRANSACTION_ID, | ||
| reportID, | ||
| ), | ||
| ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, scannableIouType ?? CONST.IOU.TYPE.SUBMIT, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, reportID), |
There was a problem hiding this comment.
It seems we don't really need this, do we? If yes, can we revert this code?
| const isSettledOrApproved = isSettled(report) || isSettled(parentReport) || isReportApproved({report}) || isReportApproved({report: parentReport}); | ||
| return (shouldAddOrReplaceReceipt && !isSettledOrApproved) || !!temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs, isReportArchived).length; | ||
| }, [shouldAddOrReplaceReceipt, report, policy, reportParticipantIDs, isReportArchived]); | ||
| return ((shouldAddOrReplaceReceipt && !isSettledOrApproved) || !!scannableIouType) && canRequestMoney; |
There was a problem hiding this comment.
@Krishna2323 do you think it's better if we explicitly exclude group chat and room here? I guess it will be easier to extend the feature later, as canRequestMoney is more complex.
There was a problem hiding this comment.
Agree with you, updated the code.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Please help review this PR again when you have time. cc @trjExpensify @jasperhuangg |
|
I'm happy with #68084 (comment) 👍 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.2.9-0 🚀
|
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.2.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.2.12-4 🚀
|

Explanation of Change
Fixed Issues
$ #66643
PROPOSAL: #66643 (comment)
Tests
Offline tests
QA Steps
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
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
Monosnap.screencast.2025-09-06.12-54-44.mp4
MacOS: Desktop
desktop_app.1.mp4