Skip to content

[auth] Add search-by-intent via ente-auth://search?query= deep link#9501

Open
bekoeppel wants to merge 3 commits intoente-io:mainfrom
bekoeppel:auth/search-by-intent
Open

[auth] Add search-by-intent via ente-auth://search?query= deep link#9501
bekoeppel wants to merge 3 commits intoente-io:mainfrom
bekoeppel:auth/search-by-intent

Conversation

@bekoeppel
Copy link
Copy Markdown

Description

  • Support launching Ente Auth with a pre-filled search query via deep link, e.g. ente-auth://search?query=gmail
  • Useful for automation tools (Tasker, shortcuts) to jump directly to a specific OTP code
  • Fix deep link stream listener not being retained, so deep links now work when the app is already open

Tests

  • Build and install the app
  • adb shell am start -a android.intent.action.VIEW -d "ente-auth://search?query=gmail" with app closed: should open with search filtered
  • Same command with app already open: should update the search
  • adb shell am start -a android.intent.action.VIEW -d "ente-auth://abcd?query=gmail": should be ignored (only /search path is accepted)
  • Verify existing otpauth:// deep links still work

Co-Authored-By: Claude <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 4, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40332ed5f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude <noreply@anthropic.com>
@bekoeppel
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17ee46b060

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude <noreply@anthropic.com>
@bekoeppel
Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AmanRajSinghMourya
Copy link
Copy Markdown
Contributor

@bekoeppel Thanks for the contribution but could you also add a video recording or a screenshot too.

@bekoeppel
Copy link
Copy Markdown
Author

Hi @AmanRajSinghMourya! Sure, happy to. Here's a quick video how I intend to use this new intent (pun intended).

demo.mp4

@bekoeppel
Copy link
Copy Markdown
Author

Hi @AmanRajSinghMourya, hope you're doing well! Were you able to take a look at the video I uploaded? Do you have any feedback for my pull request? Thank you! Benedikt

_logger.warning("Malformed ente-auth deep link: $link", e);
}
} else if (mounted && lowerLink.startsWith("otpauth://")) {
if (DateTime.now().millisecondsSinceEpoch - lastScanTime < 1000) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be better to extract this above the if-else ladder, so it applies to both enteauth and otpauth

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for your feedback!

I skipped the throttling only for ente-auth://search links on purpose, because it's OK to repeat a search query (it's idempotent, as it just filters the list).

However, the throttle already existed for OTP code additions (with otpauth:// links), I assume this is because otputh:// links add elements to the list, so we wanted to debounce that logic.

If I moved the throttle above the if-else, it adds an unnecessary delay to search deep links.

lastScanTime = DateTime.now().millisecondsSinceEpoch;
if (mounted && link.toLowerCase().startsWith("otpauth://")) {
final lowerLink = link.toLowerCase();
if (mounted && (lowerLink.startsWith("ente-auth://") || lowerLink.startsWith("enteauth://"))) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure about ente-auth:// pattern, any reason you included it here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I saw ente-auth:// pattern (with a -) is registered in AndroidManifest.xml:

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="ente-auth"/>
</intent-filter>

along with the enteauth:// pattern (without a -):

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="enteauth" />
</intent-filter>

Let me know if I should remove the one with the -.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants