Skip to content

fix: decode the deployment list when Coolify sends it as an object - #1

Merged
Skeyelab merged 1 commit into
mainfrom
fix/active-deployments-object
Sep 26, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
fix/active-deployments-object

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Polling failed with coolify unreachable: /deployments: decoding response: json: cannot unmarshal object into Go value of type []coolify.Deployment.

Coolify filters /deployments server-side, and Laravel serializes a collection with gaps in its keys as an object keyed by index rather than an array. The client now accepts both shapes, keeping the server's order, and the paged LatestDeployment decode gets the same treatment.

Test: TestActiveDeploymentsAcceptsKeyedObject covers array, keyed object, and empty object. It reproduced the reported error before the fix.

🤖 Generated with Claude Code

Coolify filters /deployments server-side, and Laravel serializes a collection
with gaps in its keys as an object keyed by index rather than an array. The
client only accepted an array, so polling failed with "cannot unmarshal object
into Go value of type []coolify.Deployment" and the whole instance showed as
unreachable. Both shapes now decode, keeping the server's order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Skeyelab
Skeyelab merged commit 0589bcf into main Sep 26, 2026
3 checks passed
@Skeyelab
Skeyelab deleted the fix/active-deployments-object branch September 26, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant