Skip to content

fix(chat-deploy): fixed chat-deploy#981

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-deploy
Aug 15, 2025
Merged

fix(chat-deploy): fixed chat-deploy#981
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-deploy

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

fixed chat-deploy for non-hosted environments

Type of Change

  • Bug fix

Testing

Tested manually.

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)

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Aug 15, 2025 8:07pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 15, 2025 8:07pm

@waleedlatif1 waleedlatif1 merged commit 03bb437 into staging Aug 15, 2025
3 of 4 checks passed
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a middleware routing issue that was preventing chat deployments from working correctly in self-hosted environments. The change modifies the middleware logic in apps/sim/middleware.ts by adding a !isCustomDomain condition to the existing self-hosted redirect check.

The root cause was that self-hosted deployments were incorrectly redirecting all root path requests (/) to workspace or login pages, including requests to chat subdomains. Chat subdomains need to serve their own chat interfaces, but the self-hosted redirect logic was intercepting these requests before they could be processed by the dedicated subdomain handling code.

The fix ensures that the self-hosted redirect behavior (lines 77+) only applies to the main domain by checking !isCustomDomain. This allows chat subdomains to be properly handled by the existing rewrite logic (lines 66-73) that serves chat functionality, while maintaining the intended redirect behavior for the main domain in self-hosted environments. The change preserves the separation between main domain functionality (workspace/login redirects) and subdomain functionality (chat interfaces).

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it's a targeted bug fix with clear logic
  • Score reflects the surgical nature of the change and clear understanding of the middleware flow
  • No files require special attention as the change is isolated and well-understood

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

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