Repository navigation
Add comment text update by edit comment - #51422
Conversation
# Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts # tests/unit/RequestConflictUtilsTest.ts
# Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts # tests/unit/RequestConflictUtilsTest.ts
…mment_text_update_by_edit_comment # Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts
|
@dukenv0307 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] |
|
@gedu Lints are failed. |
…mment_text_update_by_edit_comment # Conflicts: # tests/unit/RequestConflictUtilsTest.ts
|
@gedu Is it ready for review? |
|
@dukenv0307 yes |
|
|
||
| it('opens a chat and load initial messages', async () => { | ||
| mockOpenReport(5, '5'); | ||
|
|
There was a problem hiding this comment.
This change is unnecessary
|
Looks good, just one small problem ^ |
|
@gedu Can you add the test steps on the |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-30.at.11.00.01.movAndroid: mWeb ChromeScreen.Recording.2024-10-30.at.10.45.46.moviOS: NativeScreen.Recording.2024-10-30.at.10.58.45.moviOS: mWeb SafariScreen.Recording.2024-10-30.at.00.18.45.movMacOS: Chrome / Safariweb-resize.mp4MacOS: Desktopweb-resize.mp4 |
|
@gedu Bug:
Actual result: Expected result: |
@dukenv0307 It's not a bug, I commented here: #50074 (comment), technically we are editing so showing the edit it is ok, and because later we are merging the edit and the add, the |
|
Thank you @gedu. LGTM |
| PersistedRequests.save(newRequest); | ||
| } else if (conflictAction.type === 'replace') { | ||
| PersistedRequests.update(conflictAction.index, conflictAction.request ?? newRequest); | ||
| } else if (conflictAction.type === 'delete') { |
There was a problem hiding this comment.
Might be good to make these types a const at this point
| if (request.command === WRITE_COMMANDS.OPEN_REPORT && request.data?.parentReportActionID === reportActionID && reportActionID in commentCouldBeThread) { | ||
| const indexToRemove = commentCouldBeThread[reportActionID]; | ||
| commentIndicesToDelete.splice(indexToRemove, 1); | ||
| // The new message performs some changes in Onyx, we want to keep those changes. |
There was a problem hiding this comment.
| // The new message performs some changes in Onyx, we want to keep those changes. | |
| // The new message performs some changes in Onyx, we want to keep those changes. |
|
|
||
| Report.addComment(REPORT_ID, 'Testing a comment'); | ||
| // Need the reportActionID to delete the comments |
There was a problem hiding this comment.
| Report.addComment(REPORT_ID, 'Testing a comment'); | |
| // Need the reportActionID to delete the comments | |
| Report.addComment(REPORT_ID, 'Testing a comment'); | |
| // Need the reportActionID to delete the comments |
|
✋ 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/mountiny in version: 9.0.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.56-9 🚀
|
Details
When a EditComment is fired, the code will look for an AddComment or AttachmentWithText, if found it will look any UpdateComment in the middle to delete it, will get the AddMessage and update just the text from the EditComment.
This code is depends on: #50919
Fixed Issues
$ #50074
PROPOSAL: -
Tests
Normal Flow
Pending Flow
Offline tests
Delete No requests:
No delete Threads
All the request must be sent
Update:
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
updateCommentText_chrome.mp4
UpdateCommentText_safari.mp4
MacOS: Desktop
UpdateCommentText_desktop.mp4