Skip to content

feat(reminder): add native alarm scheduler adapter - #207

Merged
Wintercom merged 5 commits into
1024XEngineer:mainfrom
gac0812:feat/reminder-native-alarm
Aug 13, 2026
Merged

feat(reminder): add native alarm scheduler adapter#207
Wintercom merged 5 commits into
1024XEngineer:mainfrom
gac0812:feat/reminder-native-alarm

Conversation

@gac0812

@gac0812 gac0812 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 新增 TimeflowAlarmBridge:封装 Android TimeflowAlarm NativeModules 调用(调度/取消/权限状态与设置页跳转)
  • 新增 NativeAlarmScheduler,实现 AlarmSchedulerPort;模块不可用、权限不足、非法/过期时间或原生 reject 时返回 scheduled: false
  • createAppServicesalarmsMockAlarmScheduler 切换为 NativeAlarmScheduler
  • 更新 notifications barrel,导出桥接函数与 NativeAlarmScheduler
  • 补充桥接/适配器单测,mock PlatformNativeModules.TimeflowAlarm 与系统时间

Merge Order

Scope

  • frontend/src/infrastructure/notifications/native/TimeflowAlarmBridge.ts
  • frontend/src/infrastructure/notifications/NativeAlarmScheduler.ts
  • frontend/src/infrastructure/notifications/index.ts
  • frontend/src/app/composition/createAppServices.ts(仅 alarms 接线)
  • frontend/tests/unit/infrastructure/notifications/nativeAlarmScheduler.test.ts

Out of scope

Verification

  • npm run check
  • npm ci

Closes #227

Introduce TimeflowAlarmBridge and NativeAlarmScheduler, and wire the
composition root alarms port to the native Android scheduler.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 13, 2026 7:34am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Found two correctness issues in the native adapter error/result handling. npm run check passes after a clean npm ci.

Comment thread frontend/src/infrastructure/notifications/NativeAlarmScheduler.ts Outdated
Comment thread frontend/src/infrastructure/notifications/NativeAlarmScheduler.ts Outdated
mac added 2 commits August 13, 2026 10:48
Return AlarmScheduleReceipt.scheduled, map native schedule rejections to
unscheduled, and propagate the native cancel boolean instead of always
reporting success.
@gac0812

gac0812 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@fennoai /review

@fennoai

fennoai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Complete

No additional actionable findings in the pinned c1b120f...ef37d59 diff. The previously reported scheduling and cancellation contract issues are resolved in ef37d59.

  • Reviewed code quality, performance, security, and documentation accuracy
  • Verified with npm ci
  • Verified with npm run check: lint, formatting, typecheck, and 58 tests passed
  • Submitted a non-blocking PR review

View job run

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the pinned diff through code quality, performance, security, and documentation passes. The previously reported scheduling/cancellation contract issues are resolved in ef37d59; no additional actionable findings remain.

Verification: npm ci and npm run check (lint, formatting, typecheck, 58 tests) passed.

…e-alarm

Keep NativeAlarmScheduler wiring while adopting the auth runtime composition from 1024XEngineer#218.
@Wintercom

Copy link
Copy Markdown
Collaborator

【过程规范 / 阻塞合并】该 PR 没有关联对应的 Issue:描述中只有前后 PR 的合并顺序,closingIssuesReferences 也为空。git_rules.txt 第 20–23 行要求每个 PR 关联对应 Issue/功能,并以 Issue 核对范围是否一致;目前无法从可追溯的需求、验收标准判断这 4 个文件是否完整且未越界。请关联已有 Issue(例如使用 Part of #...;若该 PR 完整交付则使用 Closes #...),或先建立包含背景、目标与验收标准的 Issue。

@Wintercom

Copy link
Copy Markdown
Collaborator

【测试要求 / 阻塞合并】本 PR 新增 TimeflowAlarmBridge 和含权限、时间校验、原生异常降级、取消结果透传、批量重建等分支的 NativeAlarmScheduler,但 4 个变更文件中没有任何测试。CI 成功只能说明既有测试未回归,不能证明新增适配器可用;这不满足 git_rules.txt 第 24 行“必要测试或验证,AI 生成代码尤其要有测试兜底”的合并标准。请至少补充桥接/适配器单测,mock PlatformNativeModules.TimeflowAlarm 与时间,覆盖模块不可用、权限不足、非法/过期时间、schedule 成功与 reject、cancel true/false/reject,以及 rebuild 的多请求结果。

@Wintercom Wintercom left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git_rules.txt 的 PR 合并标准审查后,请先解决以下两项再合并:

  1. PR 未关联对应 Issue,缺少从需求、目标和验收标准到改动的可追溯关系。
  2. 新增原生闹钟桥接与调度适配器没有新增测试,现有 CI 通过不足以验证新增分支和失败降级行为。

具体要求已逐条评论。代码层面,先前 review 指出的 schedule/cancel 结果契约问题已在 ef37d59 修复;本轮未重复评论已修复事项。

@gac0812

gac0812 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

【过程规范 / 阻塞合并】该 PR 没有关联对应的 Issue……请关联已有 Issue,或先建立包含背景、目标与验收标准的 Issue。
#207 (comment)

@Wintercom 已关联对应 Issue。

已在源头仓库建立 #227(含背景、目标、非目标与验收标准,Related to #161),并挂到 milestone MS3:功能闭合与质量达标。PR 正文末尾使用 Closes #227closingIssuesReferences 现已包含该 Issue。

@gac0812

gac0812 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

【测试要求 / 阻塞合并】请至少补充桥接/适配器单测,mock PlatformNativeModules.TimeflowAlarm 与时间,覆盖模块不可用、权限不足、非法/过期时间、schedule 成功与 reject、cancel true/false/reject,以及 rebuild 的多请求结果。
#207 (comment)

@Wintercom Fixed in baa5504: 补充 frontend/tests/unit/infrastructure/notifications/nativeAlarmScheduler.test.ts

单测 mock 了 PlatformNativeModules.TimeflowAlarm 与系统时间,覆盖:模块不可用、权限不足、非法/过期时间、schedule 成功与 reject、cancel true/false/reject,以及 rebuild 的多请求混排结果。

@gac0812
gac0812 requested a review from Wintercom August 13, 2026 07:43

@Wintercom Wintercom left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Wintercom
Wintercom merged commit 7b5e544 into 1024XEngineer:main Aug 13, 2026
5 checks passed
gac0812 added a commit to gac0812/Tfgxs that referenced this pull request Aug 13, 2026
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.

feat(reminder): 接入 NativeAlarmScheduler 与 TimeflowAlarm 桥接

2 participants