Difficulty: Expert
Type: refactor
Background
The app has three distinct entry-point mechanisms into specific screens with associated data: QR access-check scans (in-app, camera-driven), deep links (custom scheme and universal link, with explicit cold-start support), and, if the push-notifications roadmap item is implemented, notification taps that also deep-link into the app — each currently handled somewhat independently.
Problem
As more entry points are added (push notifications, and potentially wallet-connect callback deep links from the Native Wallet Integration work), the risk of inconsistent behavior grows: cold start vs. warm start, navigation state clobbering an in-progress flow (e.g., a deep link arriving while the user is mid-way through a QR scan or wallet-connect flow), and duplicate/competing validation logic across each entry point.
Expected outcome
A single, unified "external entry" handling layer normalizes QR scans, deep links, and notification taps into one internal event shape, applies consistent validation and error handling (reusing the existing QR/deep-link validators rather than duplicating logic), and defines explicit, tested precedence/interruption rules for what happens when a new external entry arrives while the user is mid-flow in another one (e.g., a deep link arriving during onboarding, or a notification tap arriving during an active QR scan).
Suggested implementation
- Design a common
ExternalEntryEvent type (source: qr | deep_link | notification, target screen, params) that all three entry mechanisms normalize into, reusing the existing per-source validation logic (QR payload validator, deep-link param validator) rather than rewriting it.
- Implement a single navigation-arbitration function that decides, given the current app/navigation state and an incoming
ExternalEntryEvent, whether to navigate immediately, queue the navigation until the current flow completes, or discard it with user notification (e.g., "switched away from QR scan due to an incoming link") — document and test the exact precedence rules chosen.
- Cover cold-start and warm-start cases for all three sources through this same arbitration layer, eliminating any duplicated cold-start-specific logic.
- Add unit tests for the arbitration logic covering realistic interruption scenarios (link during onboarding, notification during QR scan, QR scan result while a deep link navigation is still pending) and Maestro E2E coverage for at least one real interruption scenario end-to-end.
- Document the full architecture, including the precedence rules and rationale, in
docs/.
Acceptance criteria
Likely affected files/directories
src/ (new unified entry-handling module)
app/ (routing/layout integration)
docs/
.maestro/
Difficulty: Expert
Type: refactor
Background
The app has three distinct entry-point mechanisms into specific screens with associated data: QR access-check scans (in-app, camera-driven), deep links (custom scheme and universal link, with explicit cold-start support), and, if the push-notifications roadmap item is implemented, notification taps that also deep-link into the app — each currently handled somewhat independently.
Problem
As more entry points are added (push notifications, and potentially wallet-connect callback deep links from the Native Wallet Integration work), the risk of inconsistent behavior grows: cold start vs. warm start, navigation state clobbering an in-progress flow (e.g., a deep link arriving while the user is mid-way through a QR scan or wallet-connect flow), and duplicate/competing validation logic across each entry point.
Expected outcome
A single, unified "external entry" handling layer normalizes QR scans, deep links, and notification taps into one internal event shape, applies consistent validation and error handling (reusing the existing QR/deep-link validators rather than duplicating logic), and defines explicit, tested precedence/interruption rules for what happens when a new external entry arrives while the user is mid-flow in another one (e.g., a deep link arriving during onboarding, or a notification tap arriving during an active QR scan).
Suggested implementation
ExternalEntryEventtype (source:qr | deep_link | notification, target screen, params) that all three entry mechanisms normalize into, reusing the existing per-source validation logic (QR payload validator, deep-link param validator) rather than rewriting it.ExternalEntryEvent, whether to navigate immediately, queue the navigation until the current flow completes, or discard it with user notification (e.g., "switched away from QR scan due to an incoming link") — document and test the exact precedence rules chosen.docs/.Acceptance criteria
docs/Likely affected files/directories
src/(new unified entry-handling module)app/(routing/layout integration)docs/.maestro/