voidzero-dev / voidzero-dev/vite-task
Define precise disableCache trigger points for uncacheable operations
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 466
- Fork
- 42
- Merge medio
- 1g 15h
- PR unite (30g)
- 19
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Traccia il percorso di avvio/ascolto del server HTTP Vite, il percorso di avvio del watcher, i percorsi generici di creazione/configurazione del server e vite_task_client::Client::disable_cache(). Verifica che la modalità di esecuzione cacheable di Vitest non esegua né listening né watching, mentre le modalità API/server e watch rinuncino a farlo ai confini delle rispettive operazioni. Dopo aver coperto la semantica, annulla il workaround no-op di PR #481 e ripristina la richiesta effettiva del client.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, rust
- Ambito
- build-system, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100