Skip to content

Fail build app when provider file writes fail#89

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-255a
Draft

Fail build app when provider file writes fail#89
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-255a

Conversation

@cursor

@cursor cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

The build-app SSE route treated GitHub/GitLab file push failures as successful writes. A provider rejection (permissions, branch/path conflict, rate limit, etc.) was only logged, then the route incremented the pushed count and emitted step: "done", causing users to see a successful build even when the remote repo was incomplete or broken.

Root cause

pushFileToGitHub and pushFileToGitLab returned normally on non-2xx provider responses. The route also converted file generation failures into placeholder error files and continued to report success.

Fix

  • Extracted provider repo/file helpers into lib/build-app-platforms.ts.
  • Changed GitHub/GitLab push helpers to throw with provider error details on non-2xx responses.
  • Changed /api/build-app to emit step: "error" and stop on generation or push failure instead of pushing placeholders or reporting done.
  • Added request validation for supported build platforms and simplified SSE closing through the route finally block.

Validation

  • pnpm exec tsc --noEmit
  • Runtime harness with mocked provider responses verified:
    • GitHub 403 rejects with GitHub rejected README.md: Protected branch
    • GitLab 400 object error rejects with provider details
    • GitHub/GitLab 201 responses still resolve successfully
Open in Web View Automation 

Co-authored-by: Cole Collins <DealPatrol@users.noreply.github.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
repo-app-architect Ready Ready Preview, Comment Jun 11, 2026 11:08am
repofuse Ready Ready Preview, Comment, Open in v0 Jun 11, 2026 11:08am
v0-repo-app-architect Ready Ready Preview, Comment, Open in v0 Jun 11, 2026 11:08am

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