Revert: "Fix: Read API is not triggered consistently when switching between features of a Collect workspace"#56932
Conversation
| useEffect(() => { | ||
| fetchFeatures(); | ||
| }, [fetchFeatures]); |
There was a problem hiding this comment.
Should not this have an empty dependency array? (same goes with other effects)
There was a problem hiding this comment.
I kept it so that if the policyID changes, the request would be sent .. i don't have a concrete reproducing steps for this but theoretically i think it's good to have it ... what do you think?
There was a problem hiding this comment.
Let's not write code for non existing flows, and remove the dependencies. We can always revisit this when needed
| useEffect(() => { | ||
| fetchData(policyID, shouldSkipVBBACall); | ||
| }, [policyID, shouldSkipVBBACall]); |
There was a problem hiding this comment.
Do we need the dependencies here?
There was a problem hiding this comment.
they were used in the reverted PR that's why i kept them https://github.com/Expensify/App/pull/38613/files#diff-be3f058d1023c441da95f052edfa6519d1581dd1c5c4cadd9ea1e7469209142f
There was a problem hiding this comment.
Let's remove them for consistency. Also because policyID does not change and the passed shouldSkipVBBACall is a constant and does not change either
|
@abzokhattab Can you update the test steps to include the ones in #56173 |
|
Updated the tests |
Reviewer Checklist
Screenshots/VideosAndroid: NativeBuild issues. Not a blocker Android: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
Can you remove this step
Why we have two shortcuts, it ssems that only the CMD + D that works |
|
Can you please remove the last step from test 1 |
|
✋ 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/roryabraham in version: 9.1.4-0 🚀
|
|
@abzokhattab QA said this PR is failing with #56173 |
|
PR fails on Desktop with the original issue Steps: Screen.Recording.2025-02-21.At.22.42.53.mp4 |
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.4-4 🚀
|
|
@abzokhattab Can you please check the above concern ^ |
|
This happens because switching features too quickly and toggling the distance rates can trigger a distance rate update before the previous fetch is complete. I'm not sure if this would actually occur in real-world scenarios. I'm not sure how to solve this if we want to... |
|
@abzokhattab Can you elaborate the requests that are fired in order and why the bug occurs? There is potentially an incorrect onyx data that we set optimistically |
|
I think its same root cause as here the write request is fired before the read request is finished .. when the read request data are returned it contains a stalled data before the write, thats why it blinks Screen.Recording.2025-02-26.at.16.55.11.mov |
|
I see, we still need to figure this one out. This bug should be reproducible everywhere, do you know other cases? Let's discuss back on the issue |
|
Removing focus based effect caused Bank - Payment account and payer fields do not appear after adding bank account |

Explanation of Change
Reverting the changes in this PR #38613
Fixed Issues
$ #56173
PROPOSAL: #56173 (comment)
Tests
Test 1:
Distance rates,Workflows,Categories,Tags,TaxesandMore FeaturesTest 2:
CMD + Dto open the troubleshooting modal and switch the"Simulate poor internet connection toggle" button on.Offline tests
Same as tests
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.Recording.2025-02-17.at.23.21.51.mov
Android: mWeb Chrome
Screen.Recording.2025-02-17.at.23.18.51.mov
iOS: Native
Screen.Recording.2025-02-17.at.23.07.15.mov
iOS: mWeb Safari
Screen.Recording.2025-02-17.at.23.08.38.mov
MacOS: Chrome / Safari
Screen.Recording.2025-02-17.at.22.36.10.mov
MacOS: Desktop
Screen.Recording.2025-02-17.at.23.28.32.mov