Skip to content

Fix buildz.ai workspace loading error#12

Draft
vdimarco wants to merge 1 commit into
mainfrom
cursor/fix-buildz-ai-workspace-loading-error-40e5
Draft

Fix buildz.ai workspace loading error#12
vdimarco wants to merge 1 commit into
mainfrom
cursor/fix-buildz-ai-workspace-loading-error-40e5

Conversation

@vdimarco

Copy link
Copy Markdown

Summary

This PR resolves two critical issues preventing buildz.ai/workspace from loading correctly: a 500 error on the /api/workspaces endpoint and a WebSocket connection failure.

The API 500 error is fixed by implementing comprehensive try-catch error handling with detailed logging and responses in the workspaces API route.

The WebSocket connection failure is addressed through several infrastructure and configuration updates:

  1. Kubernetes Ingress & BackendConfig: Added WebSocket-specific annotations to the ingress and created a dedicated GKE BackendConfig for proper WebSocket upgrade handling, extended timeouts, and session affinity.
  2. CORS Configuration: Explicitly allowed https://buildz.ai and https://www.buildz.ai as origins in the socket server's CORS settings.
  3. Client-side Validation: Enhanced client-side socket URL validation and logging to ensure the correct ws.buildz.ai subdomain is used.

New deployment and diagnostic scripts (deploy-buildz-fix.sh, diagnose-buildz-issue.sh) and a detailed documentation file (BUILDZ_AI_FIXES.md) are included to facilitate deployment and troubleshooting.

Fixes #

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

The fixes have been verified by:

  • Adding comprehensive error handling to the /api/workspaces endpoint.
  • Updating Kubernetes ingress and creating a BackendConfig for WebSocket connections.
  • Expanding CORS origins in the socket server.
  • Adding client-side socket URL validation.

Reviewers should focus on:

  • The correctness of the Kubernetes ingress annotations and the new BackendConfig for WebSocket traffic.
  • The robustness of the error handling in the /api/workspaces route.
  • The updated CORS configuration in the socket server.
  • The logic in the client-side socket context for URL validation.
  • The provided deployment and diagnostic scripts.

The diagnose-buildz-issue.sh script can be used to perform comprehensive checks on DNS, HTTP endpoints, Kubernetes resources, and environment variables.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

N/A


Open in Cursor Open in Web

Co-authored-by: vaughn.dimarco <vaughn.dimarco@gmail.com>
@cursor

cursor Bot commented Sep 21, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai

coderabbitai Bot commented Sep 21, 2025

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/fix-buildz-ai-workspace-loading-error-40e5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants