Keep bookService's segmentation key inside bookService

未关闭 适合新手
#548 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

从 src/main.ts 中引用的三个调用点开始,追踪使用分段键的 bookService 入口;阅读 #455 中的相关更改以了解背景。将键的推导移到接受 SegmentationDelta | undefined 的类型化入口之后,然后检查 bookService 之外没有调用方构造键,并确认会话调用方不再将 delta 转换为字符串后重新解析。

由索引模型根据 Issue 内容生成。

描述

main.ts builds bookService's segmentation cache key by hand at three sites, with JSON.stringify of the book's segmentation delta (#L182-L183, #L696-L699, #L1441-L1443). bookService keeps one segmented-book slot keyed by that raw string, so every caller must stringify identically or evict the others' slot, and session callers stringify a delta that bookService immediately re-parses.

Give bookService typed entry points that take SegmentationDelta | undefined and derive the key internally.

Easier after 4c (#455), which removes the source-project callers that send the delta as JSON over PAPI.

Done when: no caller outside bookService builds its segmentation key.

主要语言
TypeScript
星标
2
派生
0
平均合并
1 天 10 小时
30 天内合并 PR
74

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sillsdev/interlinearizer-extension 的其他 Issue

查看 sillsdev/interlinearizer-extension 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。