Auth config regeneration in dev can reuse a cached config
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- node.js, typescript
- Domaine
- build-system, devtools
Piste de recherche
Read packages/void/src/auth/config.ts and the watcher and generation path in packages/void/src/plugin-routing.ts; reproduce the cached-module behavior with loadVoidAuthConfig() after editing a config. Trace how local helper imports and syntax errors affect reloading. Done means regeneration uses current settings after direct config edits and helper edits, and recovers after a syntax error; an open linked pull request is already addressing this issue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
loadVoidAuthConfig() uses a plain native import() of the config file URL. Loading the same path again in the same Node process can therefore return the original module after the file has been edited.
The dev watcher explicitly handles changes to auth-config files and calls writeAuthDatabaseFiles(), which loads the config through this function. Consequently, that regeneration can use stale settings even though it was triggered by a config edit.
Documentation and intended behavior
The auth guide documents auth.ts customization and automatic auth-table creation during local development, but does not explicitly promise that auth-config edits hot-reload.
This issue is based on the existing implementation: the watcher already responds to those edits and attempts regeneration, which suggests it intends to use the updated config. This is an inference about intended behavior, not a claim that the docs guarantee hot reload. If a restart is intentionally required, that requirement should be made explicit.
Confirmed reproduction
A direct reproduction using the production loadVoidAuthConfig() function:
- Write a temporary module exporting
{ marker: 'auth-before' }. - Load it with
loadVoidAuthConfig(path). - Overwrite the same file with
{ marker: 'auth-after' }. - Call
loadVoidAuthConfig(path)again in the same process.
Both calls returned { marker: 'auth-before' }, and the returned objects were identical, although the file contained auth-after.
The loader caching was reproduced directly. A complete auth application with a schema-changing edit has not been tested end to end; the consequence for generated auth files follows from inspection of the watcher and generation path.
Expected behavior and scope
When regeneration runs in response to an auth-config edit, it should evaluate the current configuration. Restarting the dev process is the current workaround.
This behavior already exists on main and is independent of the incremental source-analysis changes in #543.
A fix should preserve existing module compatibility and cover direct config edits, edits to imported local helpers, and recovery after correcting a syntax error. Reloading only the top-level file may leave its imported dependencies cached.
Relevant code: auth config loader, routing watcher and auth-file generation.
- Langage dominant
- TypeScript
- Étoiles
- 402
- Forks
- 32
- Merge moyen
- 10 h 18 min
- PR mergées (30 j)
- 113
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de voidzero-dev/void
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
voidzero-dev/void#529 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
voidzero-dev/void#428 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 46/100
voidzero-dev/void#547 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
voidzero-dev/void#546 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 56/100
voidzero-dev/void#527 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de voidzero-dev/void
Issues similaires
-
数据界面的横向滚动条缺失Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
openclaw/openclaw#181212 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apify/apify-mcp-server#1684 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Automattic/data-liberation-agent#953 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
siteboon/claudecodeui#1642 ·
Les mainteneurs répondent en général sous 5 jours