Repository navigation
fix(mobile): match to-do link candidates by normalized repository - #8524
Conversation
The link-session sheet compared a normalized session project with the list's stored repository unchanged, so a list holding a clone URL offered no session. Both sides now use the shared project key, matching how the server-side candidate query and the session filters compare repositories.
|
bot: Android emulator E2E for the to-do link sheet, against the local dev stack with a test account seeded in the local database. The to-do list stores its repository as an https clone URL form; two stored sessions exist, one on the same repository written in ssh form and one on a different repository.
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe link-candidate filter now normalizes both the list repository and each session git URL through the existing Assumptions: Files Reviewed (4 files)
Reviewed by deepseek-flash-latest · Input: 64.1K · Output: 13.1K · Cached: 765.1K Review guidance: REVIEW.md from base branch |



Change
The link-session sheet built its repository filter from the list's stored value unchanged and compared it with a session project already normalized to
owner/repo. A list whose repository is an https or ssh clone URL, or carries a.gitsuffix, therefore matched no session and the sheet showed its empty-in-repository state.todoLinkCandidatesinapps/mobile/src/lib/todos/todo-model.tskeys both sides withprojectOptionKey, the project identity the session filters and the filter sheet already use. A list without a repository still offers every unlinked session; a session without a git URL is dropped only when the list names a repository.apps/mobile/src/components/todos/todo-link-session-sheet.tsxrenders the helper's result instead of the inline comparison.apps/mobile/src/lib/case-guard.test.ts: the allowlist entry for the sheet is gone; it existed only for the raw case call this replaces.apps/mobile/src/lib/todos/todo-model.test.ts: https, https without.git, ssh,owner/repoand a differing host case for the list against sessions of the same repository in each form; a list without a repository; an already linked session; a repository with no session.The comparison now matches the contract stated in
apps/web/src/lib/todos/git-url-project.tsand used bysameGitProjectin the mirrored candidate query, so a list's repository and a session's git URL compare the same way on both sides.Verification
Unit and static checks:
pnpm exec vitest run --project mobile-pure src/lib/todos/todo-model.test.ts src/lib/case-guard.test.ts— 27 passed.pnpm exec tsc --noEmitinapps/mobile— clean.oxlinton the four touched files — 0 warnings, 0 errors;oxfmt --checkclean.End to end on the Android emulator against the local dev stack, with a fake account in the local database:
https://github.com/drain-e2e-labs/notes.git, one open to-do in it, and two stored sessions: one on the same repository asgit@github.com:drain-e2e-labs/notes.git, one on a different repository.drain-e2e-labs/notes, still excludes the other repository's session, and tapping the row links it to the to-do (second and third captures).The three captures are in the follow-up comment.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: projectOptionKey on both sides (Recommended)
Confidence: 0.85 · Precedent: Fix the root cause and the class of the issue: "fix class of issue preventing progress". The brief also names projectOptionKey for both sides, which matches the app's single project identity.
Answer: Pure helper test only (Recommended)
Confidence: 0.75 · Precedent: Do the least work possible with no drop in quality. The emulator run already proves the wiring.
Answer: Leave the stored value (Recommended)
Confidence: 0.65 · Precedent: Keep similar elements consistent across surfaces: the to-do list row shows the stored value, so the empty state should too.