Skip to content
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

[HOLD] Website preview is shown for email addresses sent as a message in rooms #23783

Closed
2 of 6 tasks
kbecciv opened this issue Jul 28, 2023 · 17 comments
Closed
2 of 6 tasks
Assignees
Labels
Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 NewFeature Something to build that is a new item.

Comments

@kbecciv
Copy link

kbecciv commented Jul 28, 2023

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:

  1. Create a workspace if you don't have one
  2. Go to #admin of the WS
  3. Send a message with an email address
  4. Send a message with a website URL
  5. Click into a different chat, then go back into the #admin of WS

Another test case

  1. Create a room or open an existing one
  2. In the room, send a message with an email address
  3. Then send a message with a website URL
  4. Click into a different chat, then go back into the room

Expected Result:

Website previews is not should be available for email

Actual Result:

Website preview is available for email

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.46.0
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

RPReplay_Final1690385505.MP4

Expensify/Expensify Issue URL:
Issue reported by: @niravkakadiya25
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690385758858429

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fb6df989a6cc8739
  • Upwork Job ID: 1684904931252207616
  • Last Price Increase: 2023-07-28
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hungvu193
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

IOS - Website preview is available for email for #admin in WS

What is the root cause of that problem?

We're using this regex to get the link inside an a tag. The problem is, email is also a valid a tag with href.

const regex = /<a\s+(?:[^>]*?\s+)?href="([^"]*)"/gi;

Later, when we checked in here to call the preview api, it called the api preview even for email address:
const urls = ReportActionsUtils.extractLinksFromMessageHtml(props.action);
if (_.isEqual(downloadedPreviews.current, urls) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return;
}
downloadedPreviews.current = urls;
Report.expandURLPreview(props.report.reportID, props.action.reportActionID);

And our server also returned preview url for email address, which caused the issue.

What changes do you think we should make in order to solve the problem?

  • We should update our regex in here, our regex should also validate the url inside href
  • We can also add a filter here to filter only validate website url (with ValidationUtils.isValidWebsite).
  • And finally, BE need a fix to prevent return url preview for email.

What alternative solutions did you explore? (Optional)

N/A

@sonialiap
Copy link
Contributor

Reproducible

image

@sonialiap
Copy link
Contributor

sonialiap commented Jul 28, 2023

I reproduced this on Desktop app, added that to the platform list

Same behavior occurs in a manually created room. This doesn't happen in a group message.

@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Jul 28, 2023
@melvin-bot melvin-bot bot changed the title IOS - Website preview is available for email for #admin in WS [$1000] IOS - Website preview is available for email for #admin in WS Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01fb6df989a6cc8739

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

@sonialiap sonialiap changed the title [$1000] IOS - Website preview is available for email for #admin in WS [$1000] Website preview is shown for email addresses sent as a message in rooms Jul 28, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Jul 28, 2023

I think this needs to be internal as preview images are coming from ExpandURLPreview api command.

@sonialiap
Copy link
Contributor

👍 moving to internal

@sonialiap sonialiap added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Current assignee @sobitneupane is eligible for the Internal assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

@sonialiap, @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@marcaaron marcaaron removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 2, 2023
@marcaaron marcaaron self-assigned this Aug 2, 2023
@marcaaron marcaaron changed the title [$1000] Website preview is shown for email addresses sent as a message in rooms [HOLD] Website preview is shown for email addresses sent as a message in rooms Aug 2, 2023
@marcaaron marcaaron added NewFeature Something to build that is a new item. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

Current assignee @sonialiap is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Aug 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

@marcaaron marcaaron added Monthly KSv2 and removed Weekly KSv2 labels Aug 2, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@sonialiap
Copy link
Contributor

@marcaaron why is this on monthly? What are we holding for? Is this still an issue or can we close?

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@marcaaron
Copy link
Contributor

The feature was rolled back so technically there is "no bug". I am still tracking the issue in a list of improvements for when we bring it back (if we bring it back). I think probably we can remove your assignment here though as there's nothing actionable. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@marcaaron marcaaron removed the Monthly KSv2 label Oct 10, 2023
@marcaaron
Copy link
Contributor

Removing the Monthly so Melvin chills out.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Overdue labels Oct 10, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
@marcaaron marcaaron closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 NewFeature Something to build that is a new item.
Projects
None yet
Development

No branches or pull requests

7 participants