-
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
Use correct lastMessageText for attachments #15182
Conversation
@mananjadhav @dangrous One of you needs to 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] |
* @returns {Boolean} | ||
*/ | ||
export default function isReportMessageAttachment({text, html}) { | ||
return text === CONST.ATTACHMENT_MESSAGE_TEXT && html !== CONST.ATTACHMENT_MESSAGE_TEXT; |
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.
What does the second half of this do? Is it checking if someone typed the phrase [Attachment]
? I guess NAB since it was in the old function too, but out of interest...
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.
Tbh, I don't really know. Can't think of a case where the html
would be equal to [Attachment]
. Could have been someone found this bug randomly by throwing stuff at a wall, reported it, then we fixed it. Or maybe it's important 😅
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.
Ha. If it ain't broke...
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.
Code looks good!
For testing, @marcaaron can you confirm there should be a 3.5
in the Offline tests that is Delete the last attachment
before verifying that it's greyed out? That seemed right but I didn't want to just add without checking.
Oh also looks like some jest tests are failing, though as far as I can tell they're unrelated (about avatars). Maybe merge main? |
@dangrous yes thanks for catching that! |
Sweet. Good on my end - @mananjadhav all yours! |
Reviewer Checklist
Screenshots/VideosMobile Web - Chromemweb-chrome-last-attachment.movMobile Web - Safarimweb-safari-last-attachment.movDesktopdesktop-last-attachment.moviOSios-last-attachment.movAndroidandroid-last-attachment.movThanks for the patience here @dangrous @marcaaron. Tested this and it works 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/dangrous in version: 1.2.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.74-0 🚀
|
Interesting, thanks for pointing it out @s77rt. Curious though, why does it have no value and need a fallback in the first place? I would expect all supported actions should have a field of |
@marcaaron There is no value because there is no report action. The array of visibleActions is empty. If the report action is |
Ah, but is this part expected to be possibly empty or not? Is the problem that the function doesn't fail silently when an empty array is passed or that we call it with one in the first place? |
Details
When we get the
lastMessageText
we are not checking if the last message is an attachment. This leads to the text message becoming an empty string and defaulting to an email in the sidebar.Fixed Issues
$ #15140
Tests
[Attachment]
Offline tests
[Attachment]
QA Steps
Same as Web & Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Mobile Web - Chrome
FULL DISCLOSURE: I had issues testing on mWeb Chrome and skipped it since I did not want to spend too much time resolving.
Mobile Web - Safari
Desktop
iOS
Android