Repository navigation
Description
Bug: dokploy application update nullifies omitted settings (sourceType, buildType, triggerType, autoDeploy, ...)
Summary
dokploy application update sends only the flags provided on the command line as the full request body. Every setting not explicitly passed is omitted from the payload, and the server's application.update overwrites those omitted fields (observed: sourceType, buildType, triggerType, autoDeploy reset to null/None). Changing a single field via the CLI silently wipes other important application settings.
Environment
dokploy --version→0.29.14- CLI package:
@dokploy/cli0.29.14 - Server: self-hosted Dokploy (redacted host)
Repro (user-observed)
- Create an application with a real source (
github), abuildType(e.g.nixpacks), andautoDeployenabled. - Run a partial update of one field:
dokploy application update --applicationId <id> --name "Renamed"
- Open the application in the dashboard.
Expected: only name changes; sourceType, buildType, triggerType, autoDeploy remain.
Actual: sourceType, buildType, triggerType, autoDeploy are reset to None/empty.
Root cause (verified in src/generated/commands.ts, lines ~836–960)
The generated application update action collects only the flags the user provided into opts and posts them directly:
const data = await apiPost("application.update", opts);opts is never merged with the current application state read from application.one. Any field the user does not pass is therefore absent from the request body. The server's application.update tRPC procedure treats the submitted body as the desired full state and overwrites omitted fields with null/undefined, rather than leaving them unchanged.
The CLI treats update as "send what I gave you" (partial intent), while the server treats the body as authoritative/full state — a partial-update contract mismatch. The dashboard edit form does a read-then-patch merge; the CLI does not.
Additional environment note
The companion read command used to inspect before updating is currently broken too: dokploy application one --applicationId <id> fails with 400 (related to issue #48/#46 — apiGet query-param handling). Reading via a correctly-encoded API call (/api/application.one?applicationId=<id> with x-api-key) returns the full object and confirms the at-risk fields are populated (e.g. sourceType: "github", buildType: "nixpacks", triggerType: "push", autoDeploy: true).
Suggested directions (maintainers to decide)
- Client-side fix: in the
application updateaction, first fetch the current app (application.one), merge the provided flags over the returned state, and send the complete object — matching the dashboard's read-then-patch behavior. - Server-side fix: make
application.updatea true partial merge (only update keys present in the payload), which would also make the CLI's current behavior correct.
Notes
- Distinct from issues apiGet sends params as ?input=<JSON> instead of named query params — all GET commands with parameters fail (400) #48 / GET (query) requests don't wrap input in {json: ...}, breaking every parameterized read against tRPC servers using the superjson transformer #46: those concern
GET/read commands (apiGetquery-param handling) and, per apiGet sends params as ?input=<JSON> instead of named query params — all GET commands with parameters fail (400) #48, explicitly do not affectupdate(aPOST). - I did not run a destructive partial update against a live production application to reproduce, to avoid wiping real settings; the mechanism is confirmed from the generated source and the values at risk were confirmed present via the working read endpoint.
Activity
noyon-rahman commentedon Aug 17, 2026
I'd like to work on fixing this one.
I've verified the mechanism in the generated source (
src/generated/commands.ts— theapplication updateaction posts only the providedoptsviaapiPost("application.update", opts)with no read-merge), and I've got the repo set up locally withpnpm install/pnpm build/pnpm testall passing (18/18).Since the command file is auto-generated from
openapi.jsonviascripts/generate.ts(andCONTRIBUTING.mdsays not to edit the generated file by hand), I want to confirm the preferred direction before writing code:update-style commands fetch current state (application.one) and merge provided flags before posting, so omitted fields are preserved. This mirrors the dashboard's edit behavior.application.updateonly touch keys present in the payload (fix lives in Dokploy proper, a different repo).scripts/generate.tsso it emits merge logic for all update commands, not justapplication.Which direction would you prefer? If it helps, I can also reopen/re-check whether the
GET/application.oneissue (#48/#46) affects my ability to read state for the merge — I hit400onapplication onein this same0.29.14build.