Repository navigation
fix for offline money request issues - #32698
Conversation
…fline-money-request-issues
|
The PR is ready for review for the proposed issues. |
|
While testing, I found one more issue which is as below. Issue 5:Please re-state the problem that we are trying to solve in this issue.Problem : When Offline, deletion of a Money Request which has visible comments does not show greyed Money Request review in IOU Report Issue-5 Video26511-Issue-5.mp4What is the root cause of that problem?Here, we check if we need to show the preview or the deleted/reversed transaction message. During deletion of Money Request, we set the pending action as What changes do you think we should make in order to solve the problem?
Then, use That is, use and line through style here with What alternative solutions did you explore? (Optional) |
| <View style={draftMessageRightAlign}> | ||
| <ReportActionItemThread | ||
| childReportID={`${props.action.childReportID}`} | ||
| childReportID={`${props.action.childReportID || ReportActionsUtils.getIOUReportIDFromReportActionPreview(props.action)}`} |
There was a problem hiding this comment.
@rojiphil As you have already updated the optimistic data , there is no further need for this code.
There was a problem hiding this comment.
Got it. I have removed the redundant code.
| // Ignore Report Preview as last action for LHN display if the action is deleted and is also pending for deletion. | ||
| if (isReportPreviewAction(reportAction) && isMessageDeleted(reportAction) && reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Could you please explain a little bit this one, what to ignore ? and why we have to do it ?
There was a problem hiding this comment.
Could you please explain a little bit this one, what to ignore ? and why we have to do it ?
Sure. Here we use shouldReportActionBeVisibleAsLastAction to check if an action (in our case Report Preview action) can be considered as last Report Action for display of LHN subtitle display text for the Chat Report.
Before our fix, the Report Preview action was deleted in offline scenarios because of which LHN would display the subtitle text of the action that was immediately previous to the deleted Report Preview. Now, since we do not remove the Report Preview in offline scenario until app comes online, the last action would turn up to be the Report Preview thereby resulting in the text message of Report Preview as subtitle in LHN. So, we need to ignore the Report Preview action as last action for LHN if the IOU Report is deleted offline. This is the reason why we added the condition here.
So, here, we ignore the Report Preview if the message was deleted as set here and if the pending action is delete which we set here. In all other cases, we will not ignore and show the Report Preview text in LHN.
Hope this will suffice. Please let me know otherwise.
There was a problem hiding this comment.
@rojiphil Why we can't just dispaly the action as it is in offline ? when user goes online , it will be deleted and removed from Onyx. why not keeping it visible in offline ?
There was a problem hiding this comment.
Have responded here.
Let me know what you think.
…fline-money-request-issues
@fedirjh |
@rojiphil Just test with a new report with another user:
|
Issue 2: |
Thanks for the steps. That was a good catch. And the steps were also helpful in investigating this. The root cause is that after deleting the last Money Request in offline scenarios (Step 3), FE continues to add any further Money Requests (Step 4) to the same IOU Report. The BE is expecting no activity in the IOU Report once the last Money Request is deleted. The BE even creates a new IOU Report to honor subsequent money requests. So, looks like the fix from the FE is to ensure that all subsequent Money Requests are considered part of a new IOU Report. We can do so by resetting the I have committed the changes. Let me know if this is fine. |
|
But there is one more related issue I see. When offline, the user can go to the deleted IOU Report and attempt further actions using composer FAB which does not seem right. We can add a property
Let me know what you think. |
@rojiphil I think we can do similar to settled reports , we can remove the money request option from the composer action list
|
@fedirjh This tests well too. I have committed these changes. |
|
@fedirjh |
|
@rojiphil I just retested it and it looks good now. However, I found another case that we should cover. When offline, if you create a money request and then delete it, you will still be able to submit other comments inside the IOU report. However, when the user goes online, the IOU will be deleted and the comments will be lost. I think the problem arises from the backend; when the report is empty, at some point the server removes the IOU report and any further comments sent to that report will be lost. I think we should disable the composer when the last money request, inside an IOU report that doesn’t have any comments, is removed. With this fix, all aspects should be resolved, and we can proceed with the merge. Steps to reproduce
|
@fedirjh Tested and works well for me. I have committed the changes as well. |
fedirjh
left a comment
There was a problem hiding this comment.
This looks good and tests well.
|
✋ 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/blimpich in version: 1.4.24-0 🚀
|
|
This PR appears to have caused this deploy blocker. @rojiphil @fedirjh can you take a look soon and see if we can get a fix out quickly for this? Looking at the PR its not immediately clear to me what is causing the issue. Without a fix we'll have to revert. |
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.24-3 🚀
|

@fedirjh @blimpich
Details
This PR covers various offline scenarios during the deletion of Money Request in IOU Report. The issues are listed in detail under the
Testssection.Fixed Issues
$ #26511
PROPOSAL: #26511 (comment)
Tests
Issue 1:
Problem: When Offline, deleting the last Money Request (without any comments) in IOU Report removes Report Preview from parent Chat Report
Steps:
Issue 2:
Problem: When Offline, Report Preview shows TBD on deletion of last Money Request in IOU Report with comments
Steps:
Issue 3:
Problem : When Offline, Report Preview does not update amount when a new Money Request is added
Steps:
Issue 4:
Problem : When Offline, IOU Report page shows blank on navigating back from parent Chat Report via click on Reply link
Steps:
Offline tests
Same as the Steps for Tests Section.
QA Steps
Same as the Steps for Tests Section.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web-Safari
Issue-1
26511-web-safari-01_r.mp4
Issue-2
26511-web-safari-02_r.mp4
Issue-3
26511-web-safari-03-.mp4
Issue-4
26511-web-safari-04-.mp4
Desktop
Issue-1
26511-desktop-01_r.mp4
Issue-2
26511-desktop-02_r.mp4
Issue-3
26511-6-desktop-03.mp4
Issue-4
26511-6-desktop-04.mp4
Mobile Web - Chrome
Issue-1
26511-mweb-chrome-01_r.mp4
Issue-2
26511-mweb-chrome-02_r.mp4
Issue-3
26511-5-mweb-chrome-03.mp4
Issue-4
26511-5-mweb-chrome-04.mp4
Mobile Web - Safari
Issue-1
26511-mweb-safari-01_r.mp4
Issue-2
26511-mweb-safari-02_r.mp4
Issue-3
26511-3-mweb-safari-03.mp4
Issue-4
26511-3-mweb-safari-04.mp4
iOS
Issue-1
26511-ios-native-01_r.mp4
Issue-2
26511-ios-native-02_r.mp4
Issue-3
26511-ios-native-03-.mp4
Issue-4
26511-ios-native-04-.mp4
Android
Issue-1
26511-android-native-01_r.mp4
Issue-2
26511-android-native-02.mp4
Issue-3
26511-4-android-native-03.mp4
Issue-4
26511-4-android-native-04.mp4