toXlsx: the same input gives a different file on every call (zip timestamps)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
阅读第 250 行附近的 packages/pivotkit-core/src/xlsx.js,并检查 fflate 中用于修改时间字段的 zip 选项。将 modified 选项添加到 toXlsx,并将其传递给每个 zip 条目;在测试中使用固定日期。完成标准是:使用相同网格和修改时间重复调用时,生成的文件字节完全相同,同时工作簿内容保持不变。
由索引模型根据 Issue 内容生成。
描述
toXlsx produces a different file on every call for the same input, because the zip entries carry the current time. A workbook can't be compared by hash, and a scheduled report sends a "changed" file even when the data did not change.
Where: packages/pivotkit-core/src/xlsx.js line 250 calls zipSync(zipped, { level: 6 }) without a modification time, so fflate stamps each entry with the time of the call.
Not affected: the workbook content. Unzipped, every entry is byte-identical between runs; Excel and other readers don't care about the timestamps. Nothing has broken so far because no test or feature compares whole files.
Reproduce: call toXlsx twice on the same grid, compare SHA-256 of the two results: they differ; compare the unzipped entries: they match.
Fix: an option such as toXlsx(grid, { modified }) (a Date) that is passed as mtime to every zip entry, with a fixed default in tests. Check fflate's zip options for the exact field before building it. The headless report runner would pass the run's fire time, so a rerun of the same report gives the same bytes.
Found while probing headless runtimes for scheduled reports.
- 主要语言
- JavaScript
- 星标
- 1
- 派生
- 1
- 平均合并
- 3 小时 34 分钟
- 30 天内合并 PR
- 213
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eizedev/pivotkit 的其他 Issue
-
area:server enhancement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
area:server bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area:server enhancement
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
documentation idea
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
area:tests idea
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
channels:edit check:passed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
swc-project/swc-next-issues#490 ·