Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Auth config regeneration in dev can reuse a cached config

Đang mở
#550 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Brooooooklyn đang làm issue này rồi.

Từ ngày 22/10/2026.

  • #554 của @Brooooooklyn — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
node.js, typescript
Lĩnh vực
build-system, devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
402
Fork
32
Merge trung bình
10 giờ 18 phút
Pull request đã merge (30 ngày)
113

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/void

Tất cả issue của voidzero-dev/void

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.