voidzero-dev / voidzero-dev/vite-task

Define precise disableCache trigger points for uncacheable operations

Ouverte
#482 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Rust
Étoiles
466
Forks
42
Merge moyen
1 j 15 h
PR mergées (30 j)
19

Description

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 run without 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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Tracez le chemin de démarrage/écoute du serveur HTTP Vite, le chemin de démarrage du watcher, les chemins génériques de création/configuration du serveur, ainsi que vite_task_client::Client::disable_cache(). Vérifiez que le mode d’exécution cacheable de Vitest n’effectue ni listening ni watching, tandis que les modes API/server et watch se désengagent à leurs limites d’opération. Une fois les sémantiques couvertes, annulez le workaround no-op de PR #481 et restaurez la requête effective du client.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, rust
Domaine
build-system, tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.