Repository navigation
Reset last visible message on failure of attachment upload - #22342
Conversation
|
@rushatgabhane 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] |
|
@rushatgabhane Friendly bump to review the PR |
Reviewer Checklist
Screenshots/VideosWeb69b97565-0589-4a61-83b8-d21f992dc1ee.mp4Mobile Web - ChromeWhatsApp.Video.2023-07-10.at.11.35.41.mp4Mobile Web - SafariScreen.Recording.2023-07-10.at.11.42.04.movDesktopScreen.Recording.2023-07-10.at.11.12.44.moviOSScreen.Recording.2023-07-10.at.11.38.58.movAndroidScreen.Recording.2023-07-10.at.11.27.17.mov |
|
Offline and online behavior tests well |
techievivek
left a comment
There was a problem hiding this comment.
Just a quick question around lastReadTime key in failureData.
|
|
||
| const failureReport = { | ||
| lastMessageText: prevVisibleMessageText, | ||
| lastReadTime: currentTime, |
There was a problem hiding this comment.
Do we need to set the lastReadTime in failureData? Curious to learn what purpose does it serve here?
There was a problem hiding this comment.
Thanks for pointing this out. Actually, lastReadTime is not required. It is a redundant code. Sorry about that. I have removed it and tested it across 3 platforms and it works well. I will test with the remaining platforms as well and update the code.
|
@techievivek looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Not an emergency merge, all the tests were passing. |
|
✋ 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/techievivek in version: 1.3.39-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.39-11 🚀
|
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, | ||
| value: failureReport, | ||
| }, |
There was a problem hiding this comment.
This caused a regression. If we send a message after the attachment and delete that message the LHN would appear again as [Attachment]. Not exactly a bug from this PR but it caused the inconsistency as previously seeing [Attachment] in LHN was the expected results.
@rushatgabhane @techievivek
Details
The changes include adding failureReport to failureData so that if there is a failure in API.write operation, it will use the previous visible message text.
The changes are in
addActionsfunction so that this would work for bothaddAttachmentandaddCommentFixed Issues
$ #19913
PROPOSAL: #19913 (comment)
Test
Offline tests
The sidebar will continue to show this status as long as it is offline.
QA Steps
Same as above
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 */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)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
Android/Native
21_andr-native-fix.mp4
Android/Chrome
22_andr-chrome-fix.mp4
iOS/Native
23_ios-native-fix.mp4
Web/Safari
26_mac-safari-web.mp4
Web/Chrome
25_web-chrome.mp4
MacOS/Desktop
27_mac-desktop.mp4
Android/Native Offline
28_andr-native-offline.mp4