Skip to content

feat(observability): 客户端提醒送达与权限走 Sentry - #382

Open
gac0812 wants to merge 6 commits into
1024XEngineer:mainfrom
gac0812:feat/client-sentry-reminder-telemetry
Open

feat(observability): 客户端提醒送达与权限走 Sentry#382
gac0812 wants to merge 6 commits into
1024XEngineer:mainfrom
gac0812:feat/client-sentry-reminder-telemetry

Conversation

@gac0812

@gac0812 gac0812 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 提醒原生/JS 通道、厂商权限缺口改为客户端 Sentry 事件;Grafana 继续只画服务端 Prometheus。
  • 未配置 EXPO_PUBLIC_SENTRY_DSN 时 SDK 保持关闭。
  • 标签只用封闭枚举(厂商、权限、通道),不上报 session、账号、日程标题或坐标。

Related to #358

Test plan

  • 未设置 DSN 时应用可启动,且不向 Sentry 发事件
  • 原生闹钟响铃记录 native_ok,不重复记 js_channel
  • JS 回退通道记录 js_channel,事件里没有日程标题
  • 缺权限时记录封闭的 permission tags

Verification

cd frontend
npx jest tests/unit/infrastructure/observability tests/unit/shared/observability tests/architecture/sentryImportBoundary.test.ts tests/unit/features/reminder/application/LocalReminderApplication.test.ts --no-coverage

提醒响铃通道、厂商权限缺口只有手机知道;DSN 未配置时 SDK 保持关闭,标签只用封闭枚举,不上报 session 或日程原文。
送达补上触发源、延迟分桶和 deferred_until_foreground;原生 FGS 失败先落盘,下次打开 App 再报,便于在 Sentry Issues 里看到这类故障。
@gac0812
gac0812 force-pushed the feat/client-sentry-reminder-telemetry branch from 5ac4a77 to 885049e Compare August 27, 2026 05:58
@gac0812
gac0812 marked this pull request as ready for review August 27, 2026 09:30
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.71429% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/reminder/application/LocalReminderApplication.ts 94.78% 6 Missing ⚠️
...d/src/infrastructure/location/reminderGuardTask.ts 53.84% 6 Missing ⚠️
Flag Coverage Δ
backend 96.59% <ø> (ø)
frontend 90.74% <95.71%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
frontend/src/app/AppRoot.tsx 96.58% <100.00%> (+0.02%) ⬆️
frontend/src/app/composition/createAppServices.ts 100.00% <100.00%> (ø)
.../src/infrastructure/appState/RNAppStateProvider.ts 100.00% <100.00%> (ø)
...frastructure/notifications/NativeAlarmScheduler.ts 100.00% <100.00%> (ø)
...ucture/notifications/native/TimeflowAlarmBridge.ts 100.00% <100.00%> (ø)
...rastructure/observability/SentryClientTelemetry.ts 100.00% <100.00%> (ø)
...end/src/infrastructure/observability/initSentry.ts 100.00% <100.00%> (ø)
...nd/src/shared/observability/ClientTelemetryPort.ts 100.00% <100.00%> (ø)
...s/reminder/application/LocalReminderApplication.ts 93.15% <94.78%> (+0.66%) ⬆️
...d/src/infrastructure/location/reminderGuardTask.ts 64.70% <53.84%> (-0.16%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

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.

这次变更覆盖了客户端 Sentry 初始化、提醒送达/权限/生命周期埋点,以及 Android 原生失败缓冲;相关 Jest 验证通过。TypeScript 全量校验目前被一个新增的相对路径错误阻断,需先修复该导入后才能构建。

Comment thread frontend/src/features/reminder/application/interfaces/ReminderLifecyclePort.ts Outdated
README 写明 EXPO_PUBLIC_SENTRY_DSN 从何处取、未配置则 SDK 关闭,并区分 source map 与 Grafana token,避免把真实 DSN 写进仓库。
ReminderLifecyclePort 少了一层相对路径会导致 typecheck 失败;CI 的 prettier --check 也卡在四个新增 observability 文件上。
main 补充了云上观测环境变量与部署段落;冲突只在 README,两边内容都保留。
codecov/patch 要求 94%,当前 diff 只有 87.5%。补上生命周期、异常送达、headless 通道和 Sentry 适配器的未覆盖分支。
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.

1 participant