feat(pos-app): add Sentry observability - #613
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
@claude review |
|
Claude finished @ignaciosantise's task in 2m 56s —— View job Code Review
Found 7 issue(s)Issue 1: Sentry Expo plugin removed — EAS builds will produce unsymbolicated crash reportsID: brk-appjson-sentry-plugin-removed-a3c2 Context:
Recommendation: Restore the plugin: "plugins": [
"@sentry/react-native",
"expo-image",
"expo-status-bar"
]Verify the correct entry for v8 with Issue 2: Navigation container not registered — screen-level performance metrics lostID: sentry-nav-integration-missing-a3f1 (also: brk-sentryts-nav-container-unregistered-f17e) Context:
Recommendation: // sentry.ts — add and export the nav integration
export const navigationIntegration = Sentry.reactNavigationIntegration({
enableTimeToInitialDisplay: true,
});
// include in integrations array alongside reactNativeTracingIntegration// _layout.tsx — restore registration
import { useNavigationContainerRef } from "expo-router";
import { initSentry, navigationIntegration } from "@/utils/sentry";
// in useEffect after hydration + fonts:
navigationIntegration.registerNavigationContainer(navigationRef);Issue 3: Session replay enabled without explicit financial data maskingID: dcl-sentry-replay-unmask-financial-a4f2 Context:
Recommendation: import { mobileReplayIntegration } from "@sentry/react-native";
integrations: [
mobileReplayIntegration({ maskAllText: true, blockAllMedia: true }),
Sentry.reactNativeTracingIntegration({ ... }),
// ...
],Without Issue 4:
|
|
Follow-up on the seven findings:
|
930524f to
5b64fe9
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Replay is enabled for production/error cases but masked replay isn’t explicitly configured, which can risk capturing sensitive POS UI data.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Sentry v8 observability to the dapps/pos-app sample, centralizing initialization and instrumenting key POS flows (payment, printer, NFC, and screen display) while updating Expo/Sentry build-time integration for sourcemaps.
Changes:
- Introduces centralized Sentry initialization with build-variant-based environments and span sanitization hooks.
- Adds custom spans around printer/payment/NFC operations and screen TTFD markers.
- Upgrades
@sentry/react-nativeto8.23.0and updates the lockfile; adjusts Expo plugin configuration accordingly.
File summaries
| File | Description |
|---|---|
| dapps/pos-app/utils/sentry.ts | New centralized Sentry init (env tagging, tracing targets, span/request scrubbing). |
| dapps/pos-app/utils/printer.ts | Wraps printer connect/print flows in Sentry spans. |
| dapps/pos-app/utils/build-variant.ts | Adds build variant detection (development/internal/production). |
| dapps/pos-app/services/payment.ts | Adds Sentry spans for payment create/cancel requests. |
| dapps/pos-app/package.json | Bumps @sentry/react-native to v8.23.0. |
| dapps/pos-app/package-lock.json | Lockfile updates for Sentry v8 dependency graph. |
| dapps/pos-app/jest.setup.js | Mocks expo-application.applicationId and adds @sentry/react-native mocks for tests. |
| dapps/pos-app/hooks/use-nfc-payment.ts | Adds an NFC activation span; normalizes caught errors. |
| dapps/pos-app/app/scan.tsx | Adds TimeToFullDisplay marker for scan screen readiness. |
| dapps/pos-app/app/activity.tsx | Adds TimeToFullDisplay marker for activity screen readiness. |
| dapps/pos-app/app/_layout.tsx | Moves Sentry init into initSentry() and reports Sentry.appLoaded() after hydration/fonts. |
| dapps/pos-app/app.json | Removes the old Sentry plugin entry (keeps @sentry/react-native/expo). |
| dapps/pos-app/tests/utils/build-variant.test.ts | Adds unit tests for build variant detection logic. |
Review details
Files not reviewed (1)
- dapps/pos-app/package-lock.json: Generated file
- Files reviewed: 12/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Verification
npx prettier --check utils/sentry.ts app/_layout.tsx app.jsonnpx eslint utils/sentry.ts app/_layout.tsxnpm test -- --runInBand __tests__/utils/build-variant.test.ts