Define precise disableCache trigger points for uncacheable operations
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript, rust
- 领域
- build-system, tooling
调研方向
跟踪 Vite HTTP 服务器的启动/监听路径、watcher 启动路径、通用服务器创建/配置路径,以及 vite_task_client::Client::disable_cache()。验证 cacheable Vitest run 模式既不执行 listening,也不执行 watching,而 API/server 和 watch 模式则在各自的操作边界选择退出。覆盖这些语义后,撤销 PR #481 中的 no-op workaround,并恢复有效的 client request。
由索引模型根据 Issue 内容生成。
描述
Problem
disableCache() currently has an imprecise contract in practice. Tool integrations can call it while configuring a server because the configuration may later lead to an uncacheable operation. That is too early.
The observed failure mode is Vite/Vitest: a task can create a Vite server for transforms or test execution without actually listening on a port or watching the filesystem. If disableCache() fires during server/config setup, cacheable tasks such as vitest run are reported as Not cached: the task opted out of caching even though no uncacheable operation happened.
Principle
disableCache() should be called immediately before the concrete operation that makes the task uncacheable, not when reading configuration that might eventually lead to such an operation.
Concrete examples:
- Listening on a port should disable caching immediately before the listen/bind operation.
- Observing the filesystem should disable caching immediately before the watcher starts observing paths.
- Creating/configuring an object that might later listen or watch should not disable caching by itself.
Temporary workaround
PR #481 makes vite_task_client::Client::disable_cache() a no-op so false opt-outs stop affecting downstream task caching while the real fix is designed and shipped.
Real solution
Move the Vite/Vitest integration points to operation boundaries:
- In Vite, call
disableCache()from the HTTP server start/listen path immediately before binding a port. - In Vite, call
disableCache()from the watcher start path immediately before filesystem observation begins. - Do not call
disableCache()from generic server creation/config resolution paths. - Verify Vitest
runwithout watch/API does not listen or watch and therefore remains cacheable. - Verify Vitest API/server mode and watch mode still opt out because they perform uncacheable operations.
After those semantics are implemented and covered, revert the vite-task client no-op workaround and restore disableCache() as an effective client request.
- 主要语言
- Rust
- 星标
- 466
- 派生
- 42
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 21
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/vite-task 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
voidzero-dev/vite-task#738 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 78/100
voidzero-dev/vite-task#719 ·
-
难度 4/5 3-5 天 新手友好度 48/100
voidzero-dev/vite-task#717 ·
-
难度 3/5 1-2 天 新手友好度 68/100
voidzero-dev/vite-task#702 ·
-
难度 4/5 3-5 天 新手友好度 48/100
voidzero-dev/vite-task#700 · 2 条评论 ·
查看 voidzero-dev/vite-task 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
n0-computer/iroh#4550 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
paritytech/zombienet-sdk#591 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
farion1231/cc-switch#7638 · 1 条评论 ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100