Skip to content

fix: Update URL construction for Android instant app redirection #44

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kryptocodes
Copy link
Contributor

@kryptocodes kryptocodes commented Aug 9, 2025

Description

Fixed Android instant app redirect to use proper intent scheme for redirection. The previous implementation used a direct URL to the web verification page, but this change wraps it in an Android intent that will redirect users to instant app (also remove the open in browser app)

Testing (ignore for documentation update)

image

Type of change

  • Bug fix
  • [] New feature
  • [] Breaking change
  • [] Documentation update

Checklist:

Additional Notes:

If the device doesn't support instant app it will redirect to the playstore

Summary by CodeRabbit

  • Bug Fixes
    • Improved the way instant app URLs are generated and redirected for Android devices, ensuring smoother navigation to the intended app page.

Copy link

coderabbitai bot commented Aug 9, 2025

Walkthrough

The update changes the way the redirectToInstantApp method in the ReclaimProofRequest class constructs the URL for redirection. Instead of directly using an HTTPS URL, the method now wraps it inside an Android intent URI scheme string, updating the logging message to match the new format. No public interfaces or method signatures were altered.

Changes

Cohort / File(s) Change Summary
Instant App URL Construction
src/Reclaim.ts
Modified the redirectToInstantApp method to embed the HTTPS URL within an Android intent URI scheme for redirection, and updated the related log message. No changes to public API.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReclaimProofRequest
    participant AndroidApp

    User->>ReclaimProofRequest: Triggers redirectToInstantApp()
    ReclaimProofRequest->>ReclaimProofRequest: Encode template data
    ReclaimProofRequest->>ReclaimProofRequest: Construct HTTPS URL
    ReclaimProofRequest->>ReclaimProofRequest: Embed HTTPS URL in intent URI
    ReclaimProofRequest->>User: Redirects to intent URI
    User->>AndroidApp: Android handles intent URI, launches app
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A hop and a skip, the URLs now twirl,
Wrapped in intent, for Android to unfurl.
No public face changed, just logic inside,
Now instant app launches take users for a ride.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.38.6)
src/Reclaim.ts

[
{
"text": "window.postMessage(message, '')",
"range": {
"byteOffset": {
"start": 28201,
"end": 28233
},
"start": {
"line": 697,
"column": 16
},
"end": {
"line": 697,
"column": 48
}
},
"file": "src/Reclaim.ts",
"lines": " window.postMessage(message, '
');",
"charCount": {
"leading": 16,
"trailing": 1
},
"language": "TypeScript",
"metaVariables": {
"single": {},
"multi": {
"secondary": [
{
"text": "window",
"range": {
"byteOffset": {
"start": 28201,
"end": 28207
},
"start": {
"line": 697,
"column": 16
},
"end": {
"line": 697,
"column": 22
}
}
},
{
"text": "postMessage",
"range": {
"byteOffset": {
"start": 28208,

... [truncated 12152 characters] ...

illa.org/en-US/docs/Web/API/Window/postMessage\n - https://cwe.mitre.org/data/definitions/923.html",
"message": "Detected usage of wildcard '' as origin in postMessage. Always specify an exact target origin instead of using '' to prevent sensitive data from being sent to malicious websites and avoid spoofing attacks.",
"labels": [
{
"text": "window.postMessage(message, '*')",
"range": {
"byteOffset": {
"start": 28695,
"end": 28727
},
"start": {
"line": 712,
"column": 8
},
"end": {
"line": 712,
"column": 40
}
},
"style": "primary"
}
]
}
]
Error: 2 error(s) found in code.
Help: Scan succeeded and found error level diagnostics in the codebase.

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14dd33c and 15b5d12.

📒 Files selected for processing (1)
  • src/Reclaim.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Reclaim.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/instant-app-redirect

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kryptocodes kryptocodes changed the title Fix: Update URL construction for Android instant app redirection [WIP]: Update URL construction for Android instant app redirection Aug 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/Reclaim.ts (1)

735-739: Avoid logging full redirect URL (PII leakage risk)

instantAppUrl embeds JSON template (context, parameters, etc.). Logging it can leak PII. Log minimal context instead.

-            logger.info('Redirecting to Android instant app: ' + instantAppUrl);
+            logger.info(`Redirecting to Android instant app (sessionId=${this.sessionId})`);
🧹 Nitpick comments (1)
src/Reclaim.ts (1)

737-739: Optional: use replace() to avoid back-navigation and consider canonical intent fallback

  • Using window.location.replace prevents users from landing back on the intermediate page via back button.
  • For broader compatibility, consider an intent URI that uses S.browser_fallback_url (encoded) instead of query params to Play. This is a common, well-supported pattern.
-            window.location.href = instantAppUrl;
+            window.location.replace(instantAppUrl);

Example alternative intent format (for future refactor):

  • intent://<host><path>?<q>#Intent;scheme=https;S.browser_fallback_url=<encoded_play_store_url>;end;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7832579 and 14dd33c.

📒 Files selected for processing (1)
  • src/Reclaim.ts (1 hunks)

@kryptocodes kryptocodes changed the title [WIP]: Update URL construction for Android instant app redirection fix: Update URL construction for Android instant app redirection Aug 9, 2025
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.

1 participant