🔴 P0 | events.rs EVENT_BUFFER 全局缓冲区无大小上限 #38
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
events.rs 的 EVENT_BUFFER 是 static Mutex<Vec>,永不限制大小。iOS 端 collector 恢复使用后,如果网络异常导致事件无法导出,缓冲区将持续增长直至 OOM。
修复方案
位置
crates/zx_document_core/src/events.rs:8
修复完成 (2026-06-06)
实现
MAX_BUFFER_SIZE = 1000常量push_reading_event()中buf.len() >= MAX_BUFFER_SIZE时调用buf.remove(0)丢弃最旧事件再 push状态
✅ 已修复,已推送。