feat(schedule): 完成持久化提醒链路与 IM 联动 - #343
Conversation
There was a problem hiding this comment.
已检查提醒领域服务、SQLite/FATFS 持久化迁移、Runtime/IM 适配、MCP 工具及设备 Profile。当前实现有两处会影响交付:重启后可能丢失活动日程提醒,且启用 -Werror 的 Host 测试目标无法编译。python3 scripts/firmware.py validate 通过;针对性 Host 构建在以下新增提醒任务字段的初始化问题处失败。
Additional findings
components/voicelife_storage_sqlite/test/sqlite_schedule_reminder_task_repository_test.cc:?: [P1] Initialize triggered_at in all new task fixtures: Addingtriggered_atbeforecreated_atmakes the designated initializers in the new SQLite repository test (and the updated schedule reminder service test) omit a field under the repository's-Werror=missing-field-initializersflags. The targeted build fails before running any tests (sqlite_schedule_reminder_task_repository_test.cc:53, with the same error at three service-test fixtures). Add.triggered_at = std::nulloptto every fixture initializer so the Host test targets compile.
| if (!synchronized.ok() && first_failure.ok()) first_failure = synchronized; | ||
| std::unordered_set<ScheduleId> schedules_with_tasks; | ||
| for (const auto& task : *reminders.value) { | ||
| schedules_with_tasks.insert(task.schedule_id); |
There was a problem hiding this comment.
[P1] Do not suppress reminder recreation with cancelled history
schedules_with_tasks is populated for every persisted row before filtering to pending tasks. After CancelScheduleReminder() or a failed registration, an active future schedule can therefore retain only a cancelled/failed historical row; on the next Start(), line 76 sees that schedule as already having a task and skips RegisterReminder(). The schedule remains active but never receives another timer after reboot or later service restart. Track only a restorable pending task (or explicitly recreate when no pending task exists).
结论
本 PR 完成链式日程提醒机制的持久化重构,以及与现有 IM Gateway 能力的联动:
Reviewer 重点判断:
Refs #344
变更
明确未包含:
components/voicelife_storage_memory/include/voicelife/storage_memory/memory_schedule_repository.h
架构与兼容
验证
证据:
100% tests passed out of 83
PASS esp32s3-voicelife-pcb-pcm
Ran 12 tests
OK
Project build complete.
Project build complete.
Generated .../build/esp32s3-voicelife-pcb-pcm/voicelife.bin
voicelife.bin binary size 0x2bda50 bytes
0x000000 bootloader
0x008000 partition table
0x00f000 OTA data
0x020000 application
0xa10000 ESP-SR models
TDD 记录
风险与回退
Review 清单