-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this have an empty dependency array? (same goes with other effects)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not write code for non existing flows, and remove the dependencies. We can always revisit this when needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed them in this commit 3ed87c6
useEffect(() => { | ||
fetchData(policyID, shouldSkipVBBACall); | ||
}, [policyID, shouldSkipVBBACall]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the dependencies here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove them for consistency. Also because policyID does not change and the passed shouldSkipVBBACall
is a constant and does not change either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok done
@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 |
Explanation of Change
Reverting the changes in this PR #38613
Fixed Issues
$ #56173
PROPOSAL: #56173 (comment)
Tests
Test 1:
Distance rates
,Workflows
,Categories
,Tags
,Taxes
andMore Features
Test 2:
CMD + D
to 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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