Fix: App uses data from other workspace when assigning card in different workspace#55482
Conversation
|
@brunovjk sorry, these new tests took a lot of time to get sorted, The PR is ready you can continue testing, I will upload platform videos tomorrow morning as it is late for me right now, opening up for your 👀 , thanks for your patience |
| const {currentStep} = issueNewCard ?? {}; | ||
|
|
||
| const policyID = policy?.id ?? '-1'; | ||
| const policyID = policy?.id; |
There was a problem hiding this comment.
NAB: But can we use the policyID declaration in useOnyx('${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policy?.id}') above?
There was a problem hiding this comment.
I honestly don't mind updating it like this, I followed the approach used at other places in the app, totally fine either ways 😄 , let me know if we still want to update this one
There was a problem hiding this comment.
Can I check why we removed the fallback to -1? I would assume that it is more protective?
Updating to @brunovjk's suggestion sounds good 👍
There was a problem hiding this comment.
@brunovjk I updated the code, please check when you're online
Can I check why we removed the fallback to -1? I would assume that it is more protective?
@Julesssss the new ESLint rules state that we must not fallback to a string for values likepolicyIDhence i removed that the tests were failing
There was a problem hiding this comment.
Great! Thank you. @twilight2294, what do you think about getting back the fallback? But instead of using the hardcoded -1 we can use the CONST.
There was a problem hiding this comment.
policyID is a string right?, we fallback to CONST only when there is a number there, correct me if i am wrong here
There was a problem hiding this comment.
We have a new policy to always provide a fallback to a const, regardless of type. So I thiiiink -1 makes sense here for policy.
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chrome55482_android_web.moviOS: Native55482_ios_native.moviOS: mWeb Safari55482_ios_web.movMacOS: Chrome / Safari55482_web_chrome.movMacOS: Desktop55482_web_desktop.mov |
| const {translate} = useLocalize(); | ||
| const styles = useThemeStyles(); | ||
| const [issueNewCard] = useOnyx(ONYXKEYS.ISSUE_NEW_EXPENSIFY_CARD); | ||
| const policyID = policy?.id; |
There was a problem hiding this comment.
And here as well? The policyID fallback.
|
I retested, and everything looks good to me. @Julesssss all yours 🚀 |
|
Ah sorry @twilight2294 there's a conflict now |
|
@Julesssss thanks for the review, fixed the conflicts |
|
✋ 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/Julesssss in version: 9.0.90-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.90-6 🚀
|
Explanation of Change
Fixed Issues
$ #55125
PROPOSAL: #55125 (comment)
Tests
Same as QA test
Offline tests
Same as QA test
QA Steps
Verify that: The card assignment flow should start from the beginning because it is a different workspace.
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_recording_20250121_141244.mp4
Android: mWeb Chrome
Screen_recording_20250121_141821.mp4
iOS: Native
Simulator.Screen.Recording.-.Expensify.testing.-.2025-01-21.at.11.34.43.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.Expensify.testing.-.2025-01-21.at.11.39.41.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-01-21.at.11.20.58.AM.mov
MacOS: Desktop
Screen.Recording.2025-01-21.at.11.25.28.AM.mov