-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Do not always clear Onyx VBA data when accessing workspace sections #5771
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When we do
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, error: ''});
on line 348, it happens beforereimbursementAccountInSetup
is set, so it never gets populated. In this case, we need to clear it manually.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 think my first question is.... why are we using
Onyx.set()
here and above instead ofOnyx.merge()
? If there is no reason for it, then I think we should just usemerge()
in both places and then I don't think you need any of the changes to the signature offetchFreePlanVerifiedBankAccount()
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.
Correction: I mean, I think we can just use
merge()
above, and that's the only change this PR needs to make.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.
If we use merge and the bank account has been deleted on the server side (but still remains in Onyx), it will remain in Oxyx instead of getting cleared out. Handling this situation was the annoying part of the issue 😬
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.
How often would we expect that case to actually happen? Is that really a valid flow?
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 don't expect it to happen often at all. It can easily happen by deleting the bank account from oldDot, though.
Even not counting that flow, though I am not sure about using
merge
all the time. This function is used in bank account setup and I worry usingmerge
in that flow will cause unwanted behavior (after all, the comments do mention we are usingset
specifically and consciously.If we don't worry about the deleted bank account situation, though, we could get rid of this part and just have the set/merge split at the top.
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.
Yeah, I saw the comment for the original set:
I don't know that this is really the desired behavior. This is making the app the opposite of offline-first. I think we should be fine rendering whatever is in Onyx, and then load new data on top of whatever is already there. Thinking about the setup flow, if the UI was showing what was in Onyx already, then why wouldn't it be OK to keep showing it when you're offline? I would try
merge()
and just verify it doesn't change anything about the VBA flow.Regarding the delete account flow, I spoke with you 1:1 to make sure I had the full context around that and I don't think it is a flow we should worry about right now because it's a very edge case. The proper solution for handling the bank account deletion is to implement a pusher event just like we do when a new action is added to a report.
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.
Yep. I have been doing some testing on the VBA flow with
merge
and I haven't noticed any issues/differences. Let's move ahead with it, then!