Skip to content

fix(resources): pause/resume returns 'item' field matching GET shape (#81)#79

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/w10-pause-resume-response-shape-fresh
May 14, 2026
Merged

fix(resources): pause/resume returns 'item' field matching GET shape (#81)#79
mastermanas805 merged 1 commit into
masterfrom
fix/w10-pause-resume-response-shape-fresh

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Closes #81 — adapter mismatch.

Dashboard W9-B1 PauseResumeButton reads r.item (matching GET /resources/:id which already uses item). Pause/Resume previously returned only top-level fields, no nested adapted Resource. Result: button click 200s but dashboard state update silently fails.

Fix: wrap response body with item: resourceToMap(resource) to match GET shape. Legacy top-level fields preserved (additive).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Migration 024 added a CHECK constraint with only ('active','paused','expired','deleted'),
but ~220 prod rows carry status='reaped' from a prior worker cleanup job. The
migration failed in v6.0.0 rollout with:
  check constraint "resources_status_check" of relation "resources" is violated by some row

Keep 'reaped' in the allowed set rather than collapsing it into 'deleted' —
losing the worker-reaped vs user-deleted distinction would erase historical signal.

Verified: ENVIRONMENT=production, v6.0.0-2026-05-13 image, instance crash-looped on this exact constraint after 25 migrations succeeded.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the fix/w10-pause-resume-response-shape-fresh branch from cbd1f5b to 46c2c5d Compare May 14, 2026 05:12
@mastermanas805 mastermanas805 merged commit 915e173 into master May 14, 2026
mastermanas805 added a commit that referenced this pull request Jun 3, 2026
- go1.25.10 → go1.25.11 fixes GO-2026-5039/5038 (net/textproto, mime), which
  blocked govulncheck/osv-scan (same pre-existing stdlib CVE as worker #79).
- Regenerated openapi.snapshot.json for the /deploy/new 10MB cap description
  change (snapshot-drift gate).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mastermanas805 added a commit that referenced this pull request Jun 3, 2026
…age nudge) (#220)

* feat(deploy): P1 — cap /deploy/new tarball at 10 MB (413 + image nudge)

First phase of the multi-source deploy plan (PLAN-deploy-multisource-2026-06-03).
Direct source uploads on POST /deploy/new now cap at 10 MB (was 50): a 10 MB
gzipped source tar is ample for app code; larger almost always means vendored
deps / build output that belong in the build, not the upload.

- maxTarballBytes (10<<20) + enforceTarballCap() helper, applied on /deploy/new.
- Over-cap → 413 Payload Too Large (was 400), code stays `tarball_too_large`
  (no breaking rename), with a routed agent_action nudging the caller to slim
  the upload or deploy a prebuilt image (source=image, P2) instead of uploading.
- Updated codeToAgentAction["tarball_too_large"] (was 50 MiB copy) + openapi.
- Fiber global BodyLimit stays 50 MiB (/stacks/new multi-service + webhooks).
- Scope: /deploy/new only this phase. Redeploy + /stacks/new keep 50 MB —
  tightening them to 10 MB is the P1.1 fast-follow (they sit behind extra
  gates that need their own fixtures).

Tests: white-box TestEnforceTarballCap (413 + agent_action + at-cap boundary,
100% on the helper) + DB-gated TestDeployNew_OversizedTarball_413 (end-to-end
413). build + vet + agent_action contract green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(ci): bump toolchain go1.25.11 (stdlib CVE) + regen openapi snapshot

- go1.25.10 → go1.25.11 fixes GO-2026-5039/5038 (net/textproto, mime), which
  blocked govulncheck/osv-scan (same pre-existing stdlib CVE as worker #79).
- Regenerated openapi.snapshot.json for the /deploy/new 10MB cap description
  change (snapshot-drift gate).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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