mobile: 落盘环形日志(线上/真机取证通道)
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 背景
本次白屏/卡死排查(详见 makecindy/cindy#59 背景)最大的成本是**手机端没有任何落盘日志**:偶发问题无法事后取证,只能靠 Metro(dev-only)、宿主机进程采样、CDP tracing 现场蹲守;线上用户遇到同类问题时完全无从下手。dev 侧现有 `[js-stall]` 探测器与 device-link 重连 reason 日志都只进 console。
## 提案
给 mobile 加一个轻量落盘环形缓冲日志(如按大小轮转的 NDJSON,几 MB 上限):统一 logger 入口(console 拦截或显式 API),收 `[js-stall]`、device-link 连接生命周期(online/断连原因/reason 标签)、导航异常(GO_BACK 兜底触发)、未捕获错误等低频高价值事件;设置页提供「导出日志」入口(分享面板)。注意规则 23(不落任何凭证/token)与写入性能(批量/去抖落盘)。
## 验收
- 复现任一偶发问题后,能从导出的日志中还原时间线(停摆时长、断连原因、导航事件);
- 落盘写入不引入可测的 JS 卡顿(js-stall 无回归);
- 日志内容审计:无凭证、无消息正文等敏感载荷。
Contributor guide
Research direction
Start by locating the mobile implementations of the existing [js-stall] detector, device-link connection lifecycle logging, navigation fallback, uncaught-error handling, and settings export flow. Define how these events feed a bounded, rotating NDJSON buffer and how export reaches the share panel. Done means the acceptance cases pass without measurable JS stalls, and an audit confirms credentials, tokens, and message bodies are excluded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile-dev, observability, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100