-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix tag with undefined key is created in offline mode #43018
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@allgandalf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@tienifr , can you please update the PR with implementation from your main solution? We didn’t approve the alternate solution :) |
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.
NewDot is meant to work in offline mode too, I think we should not block the user from creating tags when they are offline, can you please update the code accordingly @tienifr ?
@allgandalf Sure. But we need to confirm, where we should add the optimistic policyTags data. I tried to implement my main solution, and I found out that we should not add this in here because it is read method, and the read method can just call if there is no write method in the queue: Line 166 in 24c5fe2
So that why I am implementing my alternative solution. |
Based on this comment, we can discuss the details in the PR. |
@tienifr Why can’t we set the |
@allgandalf The RCA of this issue is that, we are allowing user to create a tag that have key is 'undefined':
And this also appears in production, not only staging:
|
Yeah no conflict with your RCA, those were the basis for the selection of your proposal :), but what i want to imply is that we cannot block the user from creating tags when offline, that would be against the purpose of `ND`.
Yes we can, tagging @hayata-suenaga , please have a look at this comment, @tienifr can you please dig in deeper, because we surely want to set data optimistically than blocking the user from creating tag :) thanks |
@allgandalf Based on this comment, I think in this PR, we just need to: In here, we can early return if policyTags_${policyID}. Then we will discuss about the expected and create a follow up PR. WDYT? |
Please also update the Videos @tienifr :) |
@allgandalf I updated the video in chrome platform. I have a problem when logging in, where the server's response is too slow. That leads to I cannot add all the recordings now. Will ping you once done. |
In order to avoid the crash using
@tienifr , this way we still let the ability to disable/enable tags work while we fix the actual issue at the root! |
@allgandalf We cannot create a new tag so I wonder that how can we disable/enable it? |
We can create a new tag while offline, it's just that in PR, we added a extra prop to the Screen.Recording.2024-06-04.at.3.55.30.PM.mov |
|
Screen.Recording.2024-06-04.at.4.08.38.PM.movHere's the |
|
@allgandalf What do you think if set the optimistic data:
when calling |
But that would create a default tag called |
|
In order to solve the crash, these things should happen:
So if we are able to achieve these goals while setting the data optimistically, then we can test out the solution, would you make changes in your PR if you are able to do all the steps above with your proposed solution |
Sure. I am working on it. |
@allgandalf It looks like the same solution is just merged in latest main. I think we still need to prevent user from adding a new tag if there is no Please review the PR again |
Which PR merged this ? |
Closing in favour off #42734 |
Details
Fixed Issues
$ #42885
PROPOSAL: #42885 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Screen.Recording.2024-06-04.at.20.02.07.mov
MacOS: Chrome / Safari
output.mp4
MacOS: Desktop