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

fix email search #792

Closed
wants to merge 5 commits into from
Closed

fix email search #792

wants to merge 5 commits into from

Conversation

SabrinaTardio
Copy link
Contributor

@SabrinaTardio SabrinaTardio commented Apr 23, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/414709148257752/1207106552424205/f
iOS PR: duckduckgo/iOS#2777
macOS PR: https://github.com/duckduckgo/macos-browser/pull/2684
What kind of version bump will this require?: Patch

Description: Allows email addressed to be searched

Steps to test this PR:

  1. Type an email address and press enter
  2. Check a search is performed and not the host site visited
  3. Smoke test other searches and website visits

<!—
Before submitting a PR, please ensure you have tested the combinations you expect the reviewer to test, then delete configurations you know do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
—>

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@SabrinaTardio SabrinaTardio changed the title Sabrina/fix email search fix email search Apr 23, 2024
@SabrinaTardio SabrinaTardio marked this pull request as ready for review April 23, 2024 10:18
Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whether this is the solution we are looking for. There is a more general problem with URL parsing which has to be addressed. Valid email is just a subset of this problem.

For example, try myemail,ee@gmail.com. That's not a valid email, but it should trigger the search too.

@@ -99,6 +99,13 @@ public extension String {
return isValidHostname || isValidIpHost
}

var isValidEmail: Bool {
print(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print

@@ -138,6 +138,13 @@ extension URL {
public var isValid: Bool {
guard let navigationalScheme else { return false }

// Checks if is email if so is not considered a valid url
var trimmedURL = absoluteString.dropping(prefix: "http://")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but you can use NavigationalScheme.http.rawValue and also NavigationalScheme.separator

Copy link

github-actions bot commented May 3, 2024

This PR has been inactive for more than 7 days and will be automatically closed 7 days from now.

@github-actions github-actions bot added the stale label May 3, 2024
@github-actions github-actions bot removed the stale label May 5, 2024
Copy link

This PR has been inactive for more than 7 days and will be automatically closed 7 days from now.

@github-actions github-actions bot added the stale label May 12, 2024
Copy link

This PR has been closed after 14 days of inactivity. Feel free to reopen it if you plan to continue working on it or have further discussions.

@github-actions github-actions bot closed this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants