DOC-FULL-006 P0 | EventBuffer ack / failed / state 【status:todo】 #55

Closed
opened 2026-06-07 11:33:13 +08:00 by wangdl · 1 comment
Owner

v2 重构

模型

pub struct BufferedReadingEventV2 {
    pub event: ReadingEventV2,
    pub state: BufferedEventState,  // Pending|Exported|Failed
    pub exported_at_ms: Option<i64>,
    pub retry_count: u32,
}

API

export_pending_events_v2 / ack_events_v2 / mark_events_failed_v2

规则

  • ack 按 eventId 删除
  • Failed 可重新导出
  • 超过 1000 条: Failed→Exported→Pending 顺序清理
## v2 重构 ### 模型 ```rust pub struct BufferedReadingEventV2 { pub event: ReadingEventV2, pub state: BufferedEventState, // Pending|Exported|Failed pub exported_at_ms: Option<i64>, pub retry_count: u32, } ``` ### API export_pending_events_v2 / ack_events_v2 / mark_events_failed_v2 ### 规则 - ack 按 eventId 删除 - Failed 可重新导出 - 超过 1000 条: Failed→Exported→Pending 顺序清理
wangdl added this to the M-DOC-FULL:Document Runtime 完整阅读内核与学习事件协议 milestone 2026-06-07 11:33:13 +08:00
wangdl changed title from DOC-FULL-006 P0 | EventBuffer 导出 / ack / failed / clear 机制 to DOC-FULL-006 P0 | EventBuffer ack / failed / state 2026-06-07 11:45:15 +08:00
wangdl changed title from DOC-FULL-006 P0 | EventBuffer ack / failed / state to DOC-FULL-006 P0 | EventBuffer ack / failed / state 【status:todo】 2026-06-07 19:15:01 +08:00
Author
Owner

审查结论:document runtime 当前有文件类型识别/MaterialType/PreviewMode/DocumentInfo(基本)/Markdown解析/Text解析/ImageMeta/Search(V1 Markdown+Text)/NoteAnchor(V1)/ReadingEvent(V1)/ReadingPosition(V1)/EventBuffer(V1基础)/iOS构建/UniFFI绑定/docs。但 V2 核心模型(ReadingSession/EventV2/ActiveTimeTracker)不存在,EventBuffer 缺 ack/failed,Position 缺 camelCase+clamp,PDF/EPUB/Office 为 stub,测试覆盖不足 V2。

本 Issue: Buffer 存在(Mutex)。push/export/clear 存在。缺: ack_events/mark_failed/BufferedEventState(Pending|Exported|Failed)。clear_exported_events 按数量不按 eventId。

状态: status:todo
工作类型: work:extend-existing

## 审查结论:document runtime 当前有文件类型识别/MaterialType/PreviewMode/DocumentInfo(基本)/Markdown解析/Text解析/ImageMeta/Search(V1 Markdown+Text)/NoteAnchor(V1)/ReadingEvent(V1)/ReadingPosition(V1)/EventBuffer(V1基础)/iOS构建/UniFFI绑定/docs。但 V2 核心模型(ReadingSession/EventV2/ActiveTimeTracker)不存在,EventBuffer 缺 ack/failed,Position 缺 camelCase+clamp,PDF/EPUB/Office 为 stub,测试覆盖不足 V2。 **本 Issue**: Buffer 存在(Mutex<Vec>)。push/export/clear 存在。缺: ack_events/mark_failed/BufferedEventState(Pending|Exported|Failed)。clear_exported_events 按数量不按 eventId。 **状态**: status:todo **工作类型**: work:extend-existing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/zhixi-document-runtime#55
No description provided.