Docs cache: two call sites can still share a key through a helper's url parameter

未关闭
#751 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

Start by reading src/server/providers/docs-cache-keys.test.ts (the guard from #744) and the cached-parse path in src/server/providers/google-docs.ts, especially the miss path that skips the JSON round-trip. Then trace every call site that builds a docs-cache key and find ones where a helper takes a url parameter, since those are the shapes the current test cannot distinguish. Decide between per-parse names in the key or schema-validated reads, and make the acceptance test cache two shapes at one URL and assert a reported miss rather than a TypeError.

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

描述

Problem

The BytePlus poll failed for 1h45 on 2026-11-21 because two parsers cached different shapes under one docs-cache key (#744). The guard added there, src/server/providers/docs-cache-keys.test.ts, compares key expressions as written: it cannot see two constants holding the same URL, or a helper that takes a url parameter. cachedGoogleDocs (google-docs.ts) also has its own miss path with no JSON round-trip.

Ask

Make a collision impossible, not just tested: for example have each cached parse declare a name that goes into the key, or validate the cached shape on read with the parser's own schema and treat a mismatch as a miss that is reported.

Acceptance

  • A test that caches two shapes at one URL through a helper fails loudly at the read, not with a TypeError in the caller.
主要语言
TypeScript
星标
0
派生
1
平均合并
5 小时 40 分钟
30 天内合并 PR
193

环境准备

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

从这里开始

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

TanStack/schemas 的其他 Issue

查看 TanStack/schemas 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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