Auth config regeneration in dev can reuse a cached config
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- node.js, typescript
- 領域
- build-system, devtools
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 402
- 分支
- 32
- 平均合併
- 8 小時 32 分鐘
- 30 天內合併 PR
- 111
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
voidzero-dev/void 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
voidzero-dev/void#565 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
voidzero-dev/void#529 ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1-3 小時 新手友好度 78/100
voidzero-dev/void#428 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 53/100
voidzero-dev/void#567 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 55/100
voidzero-dev/void#564 ·
維護者通常 1 天內回覆
查看 voidzero-dev/void 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 82/100
source-cooperative/docs.source.coop#41 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
Nimblesite/SharpLsp#468 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
solidjs-community/solid-primitives#1082 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆