[codex] Structure mobile notification navigation failures#3359
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR extracts notification response handling into a separate module and adds structured error logging. The changes are a straightforward refactor with comprehensive tests - the only behavioral difference is improved error observability instead of silent failure swallowing. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 66a873e
Summary
Validation
vp test apps/mobile/src/features/agent-awareness/notificationNavigation.test.ts(9 tests)vp check(passes with 20 pre-existing warnings)vp run typecheckvp run lint:mobileOverlap
Note
Low Risk
Localized mobile notification bootstrap refactor with clearer error logging; behavior stays best-effort aside from not clearing after a routing failure.
Overview
Replaces the silent
getLastNotificationResponseAsync→ route →clearLastNotificationResponseAsyncchain inuseAgentNotificationNavigationwithconsumeLastAgentNotificationResponse, which runs read → route → clear and logs structured failures instead of swallowing errors.Adds
NotificationNavigationError(Effect tagged error) withoperation(read|route|clear), optionalnotificationId, and the originalcause. Routing errors skip clear so a failed navigation can be retried; read/route/clear failures areconsole.error’d with that shape.Tests cover which step failed, route-before-clear on clear failure, and no-clear on route failure.
Reviewed by Cursor Bugbot for commit 66a873e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add structured error logging for mobile notification navigation failures
NotificationNavigationErrorinnotificationResponseConsumer.ts, a tagged error with anoperationfield ('read','route', or'clear') and optionalnotificationId.consumeLastAgentNotificationResponse, which orchestrates reading, routing, and clearing the last notification response, logging aNotificationNavigationErrortoconsole.errorat each failure point.useAgentNotificationNavigationto delegate toconsumeLastAgentNotificationResponseinstead of an inlinethen/catchchain that swallowed errors.console.errorwith structured context instead of being silently swallowed.Macroscope summarized 66a873e.