feat: async filesystem resync with progress polling#1216
Merged
Conversation
perber
force-pushed
the
feat/async-resync-with-progress
branch
from
June 26, 2026 20:40
d54aa5c to
c2b9037
Compare
Adds a non-blocking POST /api/admin/resync endpoint that starts a background reload and returns 202 immediately. Clients poll GET /api/admin/resync/status (running/phase/done/error) until the job completes. The UI shows a live phase-progress banner. Backend: - internal/wiki/resync/job.go: ResyncJob state machine (tree→links→tags→search) - internal/wiki/resync/use_cases.go: TriggerResyncUseCase + GetResyncStatusUseCase - internal/wiki/resync/errors.go: LocalizedError codes + HTTP mapper - wiki.go: reloadWithProgress (context-aware, shutdown-cancellable via shutdownCtx), initSearch goroutine tracked in reloadWG, Close() cancels context before Wait() - cmd/leafwiki/main.go: signal handler uses TriggerResyncAsync (fire-and-forget) Frontend: - stores/resync.ts: polling loop with consecutive-error circuit breaker; !running without done=true throws 'job lost' instead of silent success - MaintenanceSettings.tsx: phase progress banner, ApiLocalizedError handling - locales/en/maintenance.json + errors.json: i18n keys for all new states
perber
force-pushed
the
feat/async-resync-with-progress
branch
from
June 26, 2026 20:48
c2b9037 to
eaf9bf4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a non-blocking POST /api/admin/resync endpoint that starts a background reload and returns 202 immediately. Clients poll GET /api/admin/resync/status (running/phase/done/error) until the job completes. The UI shows a live phase-progress banner.
Backend:
Frontend: