-
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
[Awaiting Payment][$1000] Web - URL preview not removed when editing a chat #21191
Comments
Triggered auto assignment to @Christinadobrzyn ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.After editing the link to a simple message, the site preview does not disappear. What is the root cause of that problem?The site preview for the link is displayed in the App/src/pages/home/report/ReportActionItem.js Lines 349 to 353 in 0b7455f
After editing the link, the app sends App/src/pages/home/report/ReportActionItem.js Lines 139 to 147 in 0b7455f
But for a simple message, the API returns empty What changes do you think we should make in order to solve the problem?If message is edited, we should update Following case should be considered. Therefore, I think it's best to clear useEffect(() => {
const urls = ReportActionsUtils.extractLinksFromMessageHtml(props.action);
+ if (_.isEmpty(urls) && props.action.linkMetadata) {
+ Report.clearURLPreview(props.report.reportID, props.action.reportActionID);
+ return;
+ }
if (_.isEqual(downloadedPreviews.current, urls) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return;
}
// When open report, `downloadedPreviews.current` is empty, and `linkMetadata` maybe not empty,
// so clear `linkMetata` only if `downloadedPreviews.current` is not empty and different with `urls`.
+ if (!_.isEmpty(downloadedPreviews.current)) {
+ Report.clearURLPreview(props.report.reportID, props.action.reportActionID);
+ }
downloadedPreviews.current = urls;
Report.expandURLPreview(props.report.reportID, props.action.reportActionID);
}, [props.action, props.report.reportID]); And add a function clearURLPreview(reportID, reportActionID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {
[reportActionID]: {
linkMetadata: [],
},
});
} What alternative solutions did you explore? (Optional)None. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - After edit site link to simple message then also preview is show What is the root cause of that problem?We are updating the linkMetaData in here: App/src/pages/home/report/ReportActionItem.js Lines 139 to 147 in 0b7455f
After editing the link to some text, it called Report.expandURLPreview(props.report.reportID, props.action.reportActionID); again, but it's returning empty so our old linkMetaData still persisted which caused this issue.
What changes do you think we should make in order to solve the problem?In our function editReportComment(reportID, originalReportAction, textForNewComment) {
// or we can create a new function to get html from text.
const urls = ReportActionsUtils.extractLinksFromMessageHtml({message: [{html: htmlForNewComment}]});
// update the linkMetaData if newComment doesn't have the urls.
if (_.isEmpty(urls)) {
optimisticReportActions[reportActionID].linkMetadata = [];
} What alternative solutions did you explore? (Optional)N/A |
Job added to Upwork: https://www.upwork.com/jobs/~0164e3fa7f55938949 |
Current assignee @Christinadobrzyn is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
I can reproduce - adding External label |
Triggered auto assignment to @MonilBhavsar ( |
@eVoloshchak can you review the proposals when you have a moment? Thank you! |
@StevenKKC's proposal looks good to me! 🎀👀🎀 C+ reviewed! |
Hey @MonilBhavsar Can you give your thoughts on ^ #21191 (comment) |
@eVoloshchak I think the difference between my proposal and Steven is that, my proposal only cleared the preview when there's no url inside our message. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Sorry for delay. Catching up from ooo... |
I have pushed a PR in internal repo. Thank you everyone for good discussion on this issue 🙇 |
back from ooo - I'll take this back @flaviadefaria - thanks for handling it for me. @MonilBhavsar can we move this to weekly while the PR is under review? |
PR is merged. And add regression tests for URL preview messages -
We can close this issue then |
Current assignee @eVoloshchak is eligible for the Internal assigner, not assigning anyone new. |
Current assignees @flaviadefaria and @Christinadobrzyn are eligible for the External assigner, not assigning anyone new. |
Current assignee @eVoloshchak is eligible for the External assigner, not assigning anyone new. |
Current assignee @eVoloshchak is eligible for the Internal assigner, not assigning anyone new. |
Sorry for all the labels, trying to get an Upwork job auto-created since the original one for this is closed now. Didn't work. Manually created a job in Upwork @niravkakadiya25 - I sent you an offer for $250 as reporter - can you please accept so I can pay you? Regression test here - https://github.com/Expensify/Expensify/issues/304725 |
Per this comment #21191 (comment) Paid @niravkakadiya25 $250 as reporter Closing this GH |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The preview should be gone after editing the message
Actual Result:
Preview is visible after editing the message
Workaround:
Uknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.27-6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-06-14.at.12.54.33.PM.mov
Expensify/Expensify Issue URL:
Issue reported by: @niravkakadiya25
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686727685589039
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: