Auth config regeneration in dev can reuse a cached config
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- node.js, typescript
- Bereich
- build-system, devtools
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 402
- Forks
- 32
- Ø Merge
- 10 Std. 18 Min.
- Gemergte PRs (30 T.)
- 113
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/void
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
voidzero-dev/void#529 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
voidzero-dev/void#428 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 46/100
voidzero-dev/void#547 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
voidzero-dev/void#546 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 56/100
voidzero-dev/void#527 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/void
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
cursor/community-plugins#465 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
vetro-protocol/vetro-monorepo#978 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ai-generated bug category:security effort:s priority:p3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
LanternOps/breeze#9697 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
maniator/verticopolis#1303 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
components-web-app/docs#297 ·