Skip to content

feat(mobile): enrich Sentry error context - #5432

Merged
iscekic merged 2 commits into
mainfrom
feat/mobile-sentry-context
Aug 21, 2026
Merged

feat(mobile): enrich Sentry error context#5432
iscekic merged 2 commits into
mainfrom
feat/mobile-sentry-context

Conversation

@iscekic

@iscekic iscekic commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • associate mobile Sentry events with the authenticated app user ID
  • add stable authentication and telemetry-mode tags across Sentry reinitialization
  • add safe subsystem and operation context to existing error reports
  • add fixed fingerprints for recognized synthetic failures and remove unsafe dynamic metadata

Verification

  • pnpm format
  • pnpm test (523 files, 5,340 tests)
  • pnpm typecheck
  • pnpm lint
  • pnpm check:unused
  • git diff --check

@iscekic iscekic self-assigned this Aug 21, 2026
@pandemicsyn
pandemicsyn self-requested a review August 21, 2026 17:08
Comment thread apps/mobile/src/app/_layout.tsx
@kilo-code-bot

kilo-code-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Sign-out now treats isSigningOut as signed_out with a null Sentry user, so identity cannot be re-applied during teardown.

Files Reviewed (1 file)
  • apps/mobile/src/app/_layout.tsx
Previous Review Summary (commit 8fb5361)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 8fb5361)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

Sign-out can re-bind Sentry to the previous user because the new layout context effect ignores isSigningOut while token and user id are still in React state.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/app/_layout.tsx 226 Sign-out Sentry identity can be re-applied after clearSentryUser()
Files Reviewed (40 files)
  • apps/mobile/src/app/_layout.tsx - 1 issue
  • apps/mobile/src/components/agents/attachment-picker.test.ts
  • apps/mobile/src/components/agents/attachment-picker.ts
  • apps/mobile/src/components/kilo-chat/hooks/use-mark-read.ts
  • apps/mobile/src/components/kiloclaw/onboarding/identity-step.test.tsx
  • apps/mobile/src/components/kiloclaw/onboarding/identity-step.tsx
  • apps/mobile/src/lib/agent-attachments/strip-image-metadata.test.ts
  • apps/mobile/src/lib/agent-attachments/strip-image-metadata.ts
  • apps/mobile/src/lib/agent-attachments/use-agent-attachment-upload.test.ts
  • apps/mobile/src/lib/agent-attachments/use-agent-attachment-upload.ts
  • apps/mobile/src/lib/appsflyer.test.ts
  • apps/mobile/src/lib/appsflyer.ts
  • apps/mobile/src/lib/auth/auth-context.test.ts
  • apps/mobile/src/lib/auth/auth-context.test.tsx
  • apps/mobile/src/lib/auth/auth-context.tsx
  • apps/mobile/src/lib/auth/credentials.test.ts
  • apps/mobile/src/lib/auth/logout-cleanup.test.ts
  • apps/mobile/src/lib/auth/logout-cleanup.ts
  • apps/mobile/src/lib/auth/pending-external-auth.test.ts
  • apps/mobile/src/lib/auth/pending-external-auth.ts
  • apps/mobile/src/lib/auth/use-native-auth.test.ts
  • apps/mobile/src/lib/auth/use-sso-recovery.ts
  • apps/mobile/src/lib/deep-link-launch.test.ts
  • apps/mobile/src/lib/deep-link-launch.ts
  • apps/mobile/src/lib/hooks/secure-store-preference.test.ts
  • apps/mobile/src/lib/hooks/secure-store-preference.ts
  • apps/mobile/src/lib/hooks/use-tracking-permission-prompt.test.ts
  • apps/mobile/src/lib/hooks/use-tracking-permission-prompt.ts
  • apps/mobile/src/lib/notifications.test.ts
  • apps/mobile/src/lib/notifications.ts
  • apps/mobile/src/lib/persist/drafts.test.ts
  • apps/mobile/src/lib/persist/drafts.ts
  • apps/mobile/src/lib/persist/encrypted-kv.test.ts
  • apps/mobile/src/lib/persist/encrypted-kv.ts
  • apps/mobile/src/lib/persist/mutation-outbox.test.ts
  • apps/mobile/src/lib/persist/mutation-outbox.ts
  • apps/mobile/src/lib/pr-review/pending-review-provider.mounted.test.tsx
  • apps/mobile/src/lib/pr-review/pending-review-provider.tsx
  • apps/mobile/src/lib/sentry-context.test.ts
  • apps/mobile/src/lib/sentry-context.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 127.6K · Output: 6.9K · Cached: 268.8K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic requested a review from jrf0110 August 21, 2026 17:14
@iscekic
iscekic enabled auto-merge (squash) August 21, 2026 17:29
} catch (error) {
Sentry.captureException(error);
} catch {
Sentry.captureException(new Error('Attachment image metadata strip failed'), {

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.

bot: Preserve the original image-processing failure when reporting it

Suggested fix: Bind the caught value and report that exception with the new static tags/fingerprint (for example, catch (error) { Sentry.captureException(error, { ... }) }). If raw native exception messages are intentionally excluded for privacy, route it through an approved sanitizer that still preserves safe diagnostic information such as error type and source stack; the current new Error only points to this catch handler and makes re-encode failures difficult to diagnose.

@iscekic
iscekic merged commit d019977 into main Aug 21, 2026
18 checks passed
@iscekic
iscekic deleted the feat/mobile-sentry-context branch August 21, 2026 18:01
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.

2 participants