Repository navigation
feat: show a status panel while the web server updates - #36
Merged
Merged
Conversation
The dokploy service updates stop-first, so the swarm task pulled the new 4.4 GB image only after the old container had stopped. On dev that left the panel down for 2 min 12 s (old container stopped 11:31:42, new one started 11:33:54) and Traefik answered Bad Gateway. Both update commands (AgentHits and official) now run `docker pull` first and stop if it fails, so the downtime is only the restart. The official update moves into getOfficialUpdateCommand to be testable. The update dialog used to reload after a fixed 8 s once /api/health answered. With the pull in front, the old server still answers then, so the dialog now waits until the server has gone down once and is healthy again (giving up after 20 minutes with an error). The image list and the cleanup also missed images that swarm pulls by digest: they have no tag, and `docker image ls` hides untagged images unless `-a` is passed. The running image after a UI update was one of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After "Update Server" -> "Confirm" the dialog only showed a spinner and one sentence, and during the restart the admin saw nothing useful. The server now tracks the running update job in memory: the update scripts print a marker once `docker pull` succeeded, and the new startServerUpdate runs the script, follows its output and records the phase (pulling, updating, done, failed), timestamps, docker pull layer counts, the last few output lines and a short error. The admin-only settings.getServerUpdateStatus query (classified as "read") exposes it. The state is lost when Dokploy restarts, which is expected: a fresh "idle" status is also how the UI recognises the new process. A second update request while one is running does not start another script. The dialog now renders UpdateStatusPanel, a props-driven view of four steps (downloading the image, restarting Dokploy, starting the new version, done) with done/active/pending/failed states, elapsed times and a live downtime counter. The phase logic lives in update-progress.ts as pure functions: the dialog polls the status query while the old server answers, switches to /api/health while Dokploy is down, and fails when the pull or the service update fails, when the server does not go down within 20 minutes or does not come back within 10 minutes after it stopped. A failed update keeps the dialog closable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agentHits
changed the base branch from
fix/update-prepull-image
to
AgentHits-Dev
October 7, 2026 12:13
# Conflicts: # apps/dokploy/__test__/settings/docker-server-boundary.test.ts # apps/dokploy/__test__/settings/dokploy-image-cleanup.test.ts # apps/dokploy/components/dashboard/settings/web-server/update-webserver.tsx # apps/dokploy/server/api/routers/settings.ts # packages/server/src/services/settings.ts
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.
Stacked on #35. Retarget to
AgentHits-Devafter #35 is merged.Problem
After "Update Server" -> "Confirm", the Web Server Update dialog only showed a spinner with one sentence. The admin could not tell whether the image was still downloading, whether the download failed, or how long Dokploy had been down while it restarted.
What
Server
packages/server/src/services/web-server-update.ts:startServerUpdate(command)runs the update script in the background (as before, viaspawnAsync("sh", ["-c", ...])) and tracks it in memory: phase (idle/pulling/updating/done/failed),startedAt,pulledAt,finishedAt, a short error, docker pull layer counts (total / downloaded / extracted) and the last 5 output lines. A second request while an update is running does not start another script.getAgentHitsUpdateCommand/getOfficialUpdateCommandprint a marker right afterdocker pull ... || exit 1, so the server knows when the pull finished. Pull-first,|| exit 1and the env args are unchanged.settings.updateServerusesstartServerUpdate; it still returnstrue.settings.getServerUpdateStatus, classified as"read".idlestatus is also how the UI recognises the new process.UI
UpdateStatusPanel(components/dashboard/settings/web-server/update-status-panel.tsx) is a pure view with props{ progress, now }. It shows four steps (Downloading the new image, Restarting Dokploy, Starting the new version, Done). Each step has a done / active / pending / failed state, elapsed times, layer progress, a live downtime counter and a failure box with the last output lines.update-progress.ts. The dialog pollsgetServerUpdateStatuswhile the old server answers, switches to/api/healthwhile Dokploy is down, then waits for the API to answer again (or 60 s of healthy/api/health) before the existing toast and reload.docker service updatefails, the server does not go down within 20 minutes, or it does not come back within 10 minutes after it stopped. The dialog then shows what failed and a Close button.idlestatus after a seen job counts as done.Checks
apps/dokploy:bunx tsc --noEmitpasses.packages/server:bunx tsc --noEmitpasses.bunx vitest run --config __test__/vitest.config.ts __test__/settings/ __test__/security/: 33 files, 279 tests pass. New:web-server-update-status.test.ts(output parsing, phases, failures, no double start) andupdate-progress.test.ts(phase transitions, limits, step states). Updated: the router boundary tests, and the update command tests, which now also run the markerecholine throughsh.bunx biome check --writeon the changed paths is clean.Not checked
🤖 Generated with Claude Code