Skip to content

fix: handle omi:// custom scheme for task sharing deep link - #4761

Merged
beastoin merged 1 commit into
mainfrom
fix/omi-scheme-task-deeplink
Feb 12, 2026
Merged

beastoin merged 1 commit into
mainfrom
fix/omi-scheme-task-deeplink

Conversation

@beastoin

Copy link
Copy Markdown
Collaborator

Summary

"Open in Omi" button on the task share page opens the app but nothing happens — no bottom sheet appears.

Root cause

omi://tasks/{token} URI parsing treats "tasks" as uri.host, not a path segment:

  • uri.host = "tasks"
  • uri.pathSegments = ["{token}"]

The existing check uri.pathSegments.first == 'tasks' never matches. This is the same pattern used by other omi:// handlers (uri.host == 'todoist', uri.host == 'asana', etc).

Fix

Add uri.host == 'tasks' handler in app_shell.dart, consistent with other omi:// callback handlers.

Test plan

  • iOS: open share page → tap "Open in Omi" → AcceptSharedTasksSheet appears
  • Android: same flow
  • Existing deep links unaffected (apps, wrapped, unlimited, OAuth callbacks)

🤖 Generated with Claude Code

…tern

Follow the same pattern as unlimited page (omi://h.omi.me/unlimited)
so the app's existing pathSegments routing works without changes.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@beastoin
beastoin force-pushed the fix/omi-scheme-task-deeplink branch from cc620e1 to 1645af4 Compare February 12, 2026 07:21
@beastoin
beastoin merged commit 7afd7ef into main Feb 12, 2026
2 of 3 checks passed
@beastoin
beastoin deleted the fix/omi-scheme-task-deeplink branch February 12, 2026 07:22
@beastoin

Copy link
Copy Markdown
Collaborator Author

lgtm

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request fixes an issue with deep link handling for task sharing using the "omi://" custom scheme. However, it introduces a potential path traversal vulnerability by passing an unvalidated token from the deep link to API request constructors. Additionally, the change introduces code duplication, as the logic is very similar to an existing block for handling other task sharing URIs, which could impact maintainability. This also violates the rule of preferring existing helper functions over inlining logic.

I am having trouble creating individual review comments. Click here to see my feedback.

app/lib/core/app_shell.dart (99)

security-high high

Vulnerability Alert: The token extracted from the deep link is used without validation to construct an API URL in getSharedActionItems. This creates a potential path traversal vulnerability, allowing an attacker to manipulate API requests. It is critical to validate the token format (e.g., ensuring it is alphanumeric) before use.Additionally, this code block introduces duplication with existing logic (lines 90-95), which can lead to maintenance issues. Consider extracting common logic into a private helper method for improved maintainability. This refactoring could be addressed in a follow-up PR.

        final token = uri.pathSegments.first;
        if (!RegExp(r'^[a-zA-Z0-9_-]+$').hasMatch(token)) return;
References
  1. Prefer using existing helper functions over inlining their logic, especially when they handle complex cases like fallbacks or error handling. Inlining can introduce subtle bugs by missing parts of the original logic.

@beastoin beastoin mentioned this pull request Feb 12, 2026
3 tasks done
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