Closed lanitochka17 closed 2 months ago
Triggered auto assignment to @AndrewGable (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
@AndrewGable FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
We think that this bug might be related to #wave-collect - Release 1
I'm also seeing a delay on production, I think it's just because there are a bunch of sequential API requests to finish before the view can be shown (also there's some crazy flickering, looks like it's due to rerenders; but that's unrelated)
https://github.com/Expensify/App/assets/2229301/8f159d93-bade-4b13-9c15-e08cd307f7af
Triggered auto assignment to @JmillsExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Agree with @francoisl if it's on production let's look at it like a normal bug.
@JmillsExpensify, @AndrewGable Huh... This is 4 days overdue. Who can take care of this?
@JmillsExpensify, @AndrewGable Eep! 4 days overdue now. Issues have feelings too...
@JmillsExpensify, @AndrewGable Still overdue 6 days?! Let's take care of this!
Job added to Upwork: https://www.upwork.com/jobs/~0177c40c7be0407379
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External
)
After clicking on "Connect bank account", the loading takes up to 15 seconds or sometimes it's infinite. "Hmm it's not here" error appears briefly when it loads and the user clicks somewhere to close the "Connect bank account" modal.
When CreateWorkspace
API is called, there are some gaps onyx updates between the client and the given server updates and then the queue is pause before we call EnablePolicyWorkflows
API.
After we handle the gap, the queue is unpause and we call flushOnyxUpdatesQueue
here without checking the persisted requests is empty or not and then areWorkflowsEnabled
is override as false
Another problem that makes areWorkflowsEnabled
is override is when the queue is pause, the process
function returns a resolve promise and then resolveIsReadyPromise
is called here which makes openPolicyMoreFeaturesPage
is called before EnablePolicyWorkflows
API is called
We should check the persisted requests list is empty or not before we resolve IsReady promise here
if (PersistedRequests.getAll().length === 0) {
resolveIsReadyPromise?.();
}
and flushOnyxUpdatesQueue
here
if (numberOfPersistedRequests === 0) {
flushOnyxUpdatesQueue();
}
https://github.com/Expensify/App/blob/e8ae3c5acedf0e6788dc574c7b6f3043ca37092a/src/libs/Network/SequentialQueue.ts#L151 https://github.com/Expensify/App/blob/52d4f31aeb9436ee009f862ec9bbde134cad84b8/src/libs/PolicyUtils.ts#L319
NA
@JmillsExpensify, @AndrewGable, @hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick!
@hoangzinh thoughts on the proposal above?
@JmillsExpensify @AndrewGable @hoangzinh this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@nkdengineer I think your RCA is not correct. I recall API write requests would be queued Onyx updates to avoid replay effect https://github.com/Expensify/App/blob/0424a94e8c0c6d635429b812d6b0140b73ad8645/src/libs/actions/OnyxUpdates.ts#L28-L30
Then update once here https://github.com/Expensify/App/blob/0424a94e8c0c6d635429b812d6b0140b73ad8645/src/libs/Network/SequentialQueue.ts#L134
Can you check why it's not applied in this case? Thanks
@hoangzinh Thanks for your information, I updated the RCA and solution https://github.com/Expensify/App/issues/41431#issuecomment-2105015885
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
When CreateWorkspace API is called, there are some gaps onyx updates between the client and the given server updates and then the queue is pause before we call EnablePolicyWorkflows API.
Hi @nkdengineer thanks for the updates. Can you point me to the LOC where the queue is paused before we call EnablePolicyWorkflows API.
?
Moreover, your solution might cause a regression where the network is offline, we won't trigger resolveIsReadyPromise?.()
Can you point me to the LOC where the queue is paused before we call EnablePolicyWorkflows API.?
@hoangzinh when we create a new workspace, we are missing some updates on our local storage and then the queue is pause here.
@nkdengineer can you clarify more details about what're we missing in our local storage in this case?
When I traced the log, I found that the pausing queue
come from a Pusher event
@hoangzinh Yes, this come from pusher here. Whenever we create a new workspace, we receive pusher data which makes the queue is pause and ONYXKEYS.ONYX_UPDATES_FROM_SERVER
is changed
https://github.com/Expensify/App/blob/e8ae3c5acedf0e6788dc574c7b6f3043ca37092a/src/libs/actions/User.ts#L601 https://github.com/Expensify/App/blob/e8ae3c5acedf0e6788dc574c7b6f3043ca37092a/src/libs/actions/OnyxUpdates.ts#L128
and then we handle the update gap here to sync the data from server.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@nkdengineer Actually I realize that there 2 are times that it makes SequentialQueue pause. And the time related to our bug seems the OpenReimbursementAccountPage
API
Btw can you take a look at RCA again and my feedback about your solution here? Thanks
@nkdengineer Actually I realize that there 2 are times that it makes SequentialQueue pause. And the time related to our bug seems the OpenReimbursementAccountPage API
@hoangzinh Thanks for your feedback, the not found page still appears even we don't click on Connect bank account
which makes OpenReimbursementAccountPage
is called.
Moreover, your solution might cause a regression where the network is offline, we won't trigger resolveIsReadyPromise?.()
For that, we can add the check offline to triggerresolveIsReadyPromise?.()
if (NetworkStore.isOffline() || PersistedRequests.getAll().length === 0) {
resolveIsReadyPromise?.();
}
but the PusherEvent
that causes SequentialQueue
pause happens before we call CreateWorkspace
@hoangzinh I tested and sometimes the PusherEvent
happens before CreateWorkspace
, sometimes it happens after CreateWorkspace
. I think it's based on backend and network. So summary of the issue's RCA: The bug will happen if a PusherEvent
comes between CreateWorkspace
and EnablePolicyWorkflows
API makes the queue is paused and then a read API is called before EnablePolicyWorkflows
API which overrides the policy data. What do you think?
So summary of the issue's RCA: The bug will happen if a PusherEvent comes between CreateWorkspace and EnablePolicyWorkflows API makes the queue is paused and then a read API is called before EnablePolicyWorkflows API which overrides the policy data
Nope, I don't think so. Let's take a look at my recording below, I can reproduce this bug with PusherEvent (that would pause the queue) happens before CreateWorkspace and EnablePolicyWorkflows API
https://github.com/Expensify/App/assets/9639873/014d893b-716d-4cd8-8c92-d7667894eff9
@hoangzinh Thanks for your feedback, I checked again, the queue is paused after CreateWorkspace
API is called and before CreateWorkspace
is complete. But the queue is unpaused after CreateWorkspace
API is complete which makes resolveIsReadyPromise
is resolved after CreateWorkspace
API is complete and then the read API is called immediately
@JmillsExpensify @AndrewGable @hoangzinh this issue is now 4 weeks old, please consider:
Thanks!
@nkdengineer I guess the reason why when the SequentialQueue is paused, we would like to update all OnxyUpdateQueue to prevent it would overwriting data from API GetMissingOnyxMessages later. If our solution prevents updating all OnxyUpdateQueue, that would cause unknown regressions.
the queue is paused after CreateWorkspace API is called and before CreateWorkspace is complete
Is there any way that we can prevent it happens?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Issue not reproducible during KI retests. (First week)
I guess the reason why when the SequentialQueue is paused, we would like to update all OnxyUpdateQueue to prevent it would overwriting data from API GetMissingOnyxMessages later. If our solution prevents updating all OnxyUpdateQueue, that would cause unknown regressions.
@hoangzinh Our solution will only prevent updating the OnyxUpdate of write API if we still have some write API in the queue.
GetMissingOnyxMessages
API is a read API and the OnyxData of this will update to Onyx immediately
Is there any way that we can prevent it happens?
I think we can't because it depends on when BE sends the pusher data.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Workspace - Long loading and errors after a new non USD WS offline and adding a bank account
Policy is not ready to use when we connect a bank account. There are too many fields missing in the optimistic data.
Better to wait until workspace created to show bank account page. Change this check to:
const isLoading = (!!isLoadingApp || !!account?.isLoading || isReimbursementAccountLoading || policy?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) && (!plaidCurrentEvent || plaidCurrentEvent === CONST.BANK_ACCOUNT.PLAID.EVENTS_NAME.EXIT);
Or
const isLoading = (!!isLoadingApp || !!account?.isLoading || isReimbursementAccountLoading || policy?.pendingAction) && (!plaidCurrentEvent || plaidCurrentEvent === CONST.BANK_ACCOUNT.PLAID.EVENTS_NAME.EXIT);
Add missing required values to optimistic data, but IMO this approach will require a lot of trial errors to find the required values
Hi @wildan-m, does your proposal work when network is offline?
@hoangzinh I can't reproduce it anymore, seems we can close it
I couldn't reproduce this issue either. @JmillsExpensify can you ask QA to test this issue again before we close it? Thanks
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Waiting to re-test again.
@JmillsExpensify, @AndrewGable, @hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick!
Asked QA to test again.
Tester is still able to reproduce.
https://github.com/Expensify/App/assets/43996225/7a842bd5-c5bd-49b4-b2ca-0847c956a53e
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@JmillsExpensify, @AndrewGable, @hoangzinh Eep! 4 days overdue now. Issues have feelings too...
@JmillsExpensify, @AndrewGable, @hoangzinh 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
QA is able to reproduce so keeping this open.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.69.0 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4529975&group_by=cases:section_id&group_id=283225&group_order=asc Issue reported by: Applause - Internal Team
Action Performed:
Precondition: Your default workspace currency shouldn't be USD
Expected Result:
The loading shouldn't take long and there shouldn't be any errors while adding a bank account
Actual Result:
After clicking on "Connect bank account", the loading takes up to 15 seconds or sometimes it's infinite. "Hmm it's not here" error appears briefly when it loads and the user clicks somewhere to close the "Connect bank account" modal.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/d9291ee1-a600-4b9e-9788-125f3c266d90
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @hoangzinh