feat: 会话 jsonl 时间戳改为上海时间 - #1363
jianYanZhiX7 wants to merge 1 commit into
Conversation
写入时将顶层 timestamp 序列化为 +08:00 偏移写法, 使会话文件可直接读作本地时间,同时保持 ISO-8601 严格性。 - 新增 src/utils/shanghaiTimestamp.ts:转换、改写与时刻比较 - 5 个写入点接入转换(主写入队列、远程水合、CCR v2 前台与子代理、追加写入) - 2 处排序改为按真实时刻比较,修正 Z 与 +08:00 混存时的字典序错序 - 嵌套时间戳不改写,避免污染 toolUseResult 与 MCP 元数据 - 补充 shanghaiTimestamp 单元测试(10 个用例)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds Shanghai timestamp utilities and tests. Transcript hydration paths now normalize timestamps before serialization. Transcript recovery and loading now compare mixed-offset timestamps by instant. ChangesTimestamp handling
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
会话 jsonl 转录在写入时将顶层
timestamp序列化为+08:00偏移写法,使会话文件可直接读作本地时间,同时保持 ISO-8601 严格性(Date.parse语义不变)。改动
src/utils/shanghaiTimestamp.ts:toShanghaiISOString/toShanghaiTimestamp/withShanghaiTimestamp/compareTimestampshydrateRemoteSession、CCR v2 前台转录与子代理转录、appendEntryToFilerecoverOrphanedParallelToolResults、loadAllLogsFromSessionFile),修正...Z与+08:00混存时的字典序错序toolUseResult/ MCP 元数据等不透明载荷保持逐字节 round-trip变更文件
src/utils/shanghaiTimestamp.ts(61 行)、src/utils/__tests__/shanghaiTimestamp.test.ts(10 个用例)src/utils/sessionStorage.ts(17+/9-)Test plan
bun run precheck全绿:typecheck 零错误 + biome 零修复bun test:6032 pass / 10 skip / 0 failSummary by CodeRabbit
+08:00).