Repository navigation
feat: Task sharing via link (#4727) - #4737
Conversation
Backend implementation:
- POST /v1/action-items/share: create shareable link (validates ownership)
- GET /v1/action-items/shared/{token}: public preview (description + due_at only)
- POST /v1/action-items/accept: save shared tasks (prevents self/duplicate accept)
- Completion hook: notifies sender when recipient completes shared task
- Redis token storage with 30-day TTL
- 10 unit tests, all pass
Co-Authored-By: Claude Opus 4.6 <[email protected]>
) Web: - Server action to fetch shared tasks from API - Dynamic page at /tasks/[token] with task preview, CTA, store badges App (Flutter): - API functions: shareActionItems, getSharedActionItems, acceptSharedActionItems - Deep link handler for /tasks/{token} in app_shell.dart - AcceptSharedTasksSheet bottom sheet for accepting shared tasks - Share button in ActionItemFormSheet (edit mode) Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces a robust task sharing feature across the backend, web, and mobile app. The implementation is well-structured, with new API endpoints, Redis-based token management, a deep linking mechanism, and corresponding UI components. The backend includes unit tests that cover the new functionality well. I've identified a critical race condition in the task acceptance flow that could lead to data duplication, and an opportunity to significantly improve user experience by propagating specific error messages from the backend to the client. My review comments focus on addressing these high-severity issues.
The Next.js dynamic route is [token], so params.token is the correct property. Using params.id was undefined. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- store_task_share now returns result; router checks for None → 500 - has_accepted_task_share None check → 503 instead of silent bypass - Notification description truncation adds '...' at 60 chars - Added 2 unit tests for Redis failure scenarios (12 total) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Prevents title from being too tight against the omi nav banner. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Replace separate has_accepted/mark_accepted with atomic try_accept_task_share using SADD return value (fixes race condition on duplicate accept) - Fix OG URL double-slash by using URL constructor instead of string template - Update unit tests for new atomic function Co-Authored-By: Claude Opus 4.6 <[email protected]>
Live Local Dev Test ResultsBackend API Tests (14/14 passed)Tested against local backend ( Web Frontend Tests (15/15 passed)Tested Next.js dev server on ScreenshotsFixes Applied (from review feedback)
Remaining (not in scope for this commit)
by AI for @beastoin |
- Reduce h1 to text-2xl on mobile, scale up at sm/md breakpoints - Add break-words to prevent text overflow on narrow viewports - Add overflow-x-hidden to container - Add min-w-0 to task description flex child Co-Authored-By: Claude Opus 4.6 <[email protected]>
Adds an intent-filter with pathPattern /tasks/.* to
intercept h.omi.me/tasks/{token} links and open them
directly in the app for task sharing acceptance.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Enables iOS to intercept h.omi.me/tasks/{token} URLs and
open them directly in the app for task sharing acceptance.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
getInitialLink() captures the URI that launched the app from a terminated state. Without this, task sharing links only work when the app is already running (warm start). Co-Authored-By: Claude Opus 4.6 <[email protected]>
CTA button now uses Android intent:// URI with fallback and iOS Universal Link instead of plain store links. Also fixes Prettier formatting issues that failed CI lint. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Pixel 7a (33041JEHN18287) launched from adb am start with
h.omi.me/tasks/{token} URI — app opens instead of browser,
proving the Android intent filter intercepts task share links.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
After deep link launch, app navigated to sign-in page. Confirms the full app lifecycle works from cold start via deep link (getInitialLink -> onboarding). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Side-by-side showing: Chrome (before) → Omi app launched (after)
from adb shell am start with h.omi.me/tasks/{token} URL.
Tested on Pixel 7a (33041JEHN18287) via remote ADB.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Device Test Results (Pixel 7a)Device: Pixel 7a (<REDACTED_SERIAL>) via ADB over Tailscale Tests Performed
ScreenshotsDeep link launch (app opens from Sign-in page (app navigated after deep link cold start): Note on Accept FlowThe dev flavor's Google Sign-In redirects to Summary
by AI for @beastoin |
Device Test Results (Pixel 7a, remote ADB)Device: Pixel 7a (<REDACTED_SERIAL>), Android, via remote ADB over Tailscale Deep Link Interception Test
ScreenshotLeft: Chrome before deep link. Right: Omi app launched after Accept Flow (partial)Could not complete full accept flow — dev build's Google OAuth redirects to a local auth proxy (
Fixes Applied (this push)
by AI for @beastoin |
|
nice try btw let me guide you: 0/ map your omi web url to beastoinx-1.tailc94d.ts.net:11188 1/ you must log in successfully to the test app before performing the deeplink test. you need to verify end to end your changes and see them on the screen. |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Device Test Results (Pixel 7a via ADB)Setup: APK installed on Pixel 7a (dev flavor), tested deep link intent routing. Verified
Limitation
Evidence |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Uses Firebase Auth via database/auth.get_user_name() to resolve display names, matching the existing pattern used in notifications and app author attribution. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace Firestore profile lookup (which has no name fields for most users) with get_user_display_name() that reads from Firebase Auth. This fixes the share sheet showing "Someone" instead of the actual sender name like "Nik shared 2 tasks with you". Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace get_user_profile patches with get_user_display_name to match the new utils/users.py import in action_items.py. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Covers get_user_display_name fallbacks (None, empty, custom default), ShareTasksRequest min/max validation (0, 20, 21 task_ids), and TASK_SHARE_TTL constant. Total: 20 tests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…t SHA) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Can you run the e2e testing for the flow where users do not have the app installed? |
E2E: Web flow for users without the appTested on Pixel 7a Chrome — opening the share link directly in the browser (simulating user without Omi installed): What the user sees
"Open in Omi" fallback behaviorThe button uses Android Intent URLs with
On iOS, Universal Links handle the deep link, with App Store badge as fallback. |
|
ok thanks, pls resolve the conflict then we go. |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Conflict resolved (just |
|
lgtm |
Production Deep Link VerifiedConfirmed end-to-end task sharing deep link is working on production iOS (latest build):
Two follow-up fixes were needed after initial merge:
All three PRs merged and deployed to production. Feature is live and working. |
Tip for iOS users: Universal Links may require app reinstallIf you're on iOS and tapping an Why: iOS fetches and caches the Reinstalling forces iOS to re-fetch the AASA from Confirmed by CTO — his app was updated via internal test before the web page went live, so the AASA wasn't serving @Chen (RepoOps) |















Summary
POST /share,GET /shared/{token},POST /accept) + Redis token storage (30-day TTL) + completion notification to sender when shared task is completed +utils/users.pyfor Firebase Auth display name retrieval/tasks/[token]with task preview, sender name, CTA button, and app store badges/tasks/{token},AcceptSharedTasksSheetbottom sheet with task preview and one-tap addHow it works
h.omi.me/tasks/{token})Security
description+due_at(noconversation_id, nocompleted, nois_locked)Files changed (task sharing specific)
routers/action_items.pydatabase/redis_db.pyutils/users.pyget_user_display_name()via Firebase Authtests/unit/test_task_sharing.pytest.shapp/tasks/[token]/page.tsxactions/tasks/get-shared-tasks.ts.well-known/apple-app-site-association/tasks/*accept_shared_tasks_sheet.dartaction_item_form_sheet.dartaction_items_page.dartapp_shell.dart/tasks/{token}Test plan
Closes #4727
🤖 Generated with Claude Code