Auth config regeneration in dev can reuse a cached config
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- node.js, typescript
- Domínio
- build-system, devtools
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 402
- Forks
- 32
- Merge médio
- 10h 18min
- PRs com merge (30d)
- 113
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de voidzero-dev/void
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
voidzero-dev/void#529 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
voidzero-dev/void#428 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 46/100
voidzero-dev/void#547 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
voidzero-dev/void#546 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 56/100
voidzero-dev/void#527 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de voidzero-dev/void
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
cursor/community-plugins#465 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
vetro-protocol/vetro-monorepo#978 ·
Mantenedores costumam responder em até 1 dia
-
ai-generated bug category:security effort:s priority:p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
LanternOps/breeze#9697 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
maniator/verticopolis#1303 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
components-web-app/docs#297 ·