Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Auth config regeneration in dev can reuse a cached config

Aberta
#550 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@Brooooooklyn já está trabalhando nisso.

Desde 22/10/2026.

  • #554 de @Brooooooklyn — aberto

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

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:

  1. Write a temporary module exporting { marker: 'auth-before' }.
  2. Load it with loadVoidAuthConfig(path).
  3. Overwrite the same file with { marker: 'auth-after' }.
  4. 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

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de voidzero-dev/void

Todas as issues de voidzero-dev/void

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.