fix(utils): fallback to ROOT_URL when Site_Url is not configured in getURL#38868
fix(utils): fallback to ROOT_URL when Site_Url is not configured in getURL#38868sahillllllllll-bit wants to merge 1 commit intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
WalkthroughUpdated the fallback for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
@KevLehman i think this is valid bug. wdyt ? and @sahillllllllll-bit can you tell me how to setup rocket.chat locally , in my machine it is showing errors only |
in your bio written that maintainer and u asking about setup ?? |
Proposed changes
getURLcurrently depends only on theSite_Urlsetting:When Site_Url is not configured (very common during first startup, fresh Docker deployments, or test environments), the server generates relative URLs instead of absolute URLs.
Examples produced:
Instead of:
This function is widely used across the server to generate links for:
Relative URLs in these contexts break external access because email clients and external authentication providers require absolute URLs.
This PR adds a fallback to
process.env.ROOT_URLso the server always produces an absolute URL when Site_Url is not yet configured.This keeps the existing behavior unchanged when Site_Url is properly configured.
Issue(s)
Closes #38867
The issue was reproduced locally and the incorrect behavior was also highlighted during automated review.
Steps to test or reproduce
Further comments
This is a small server-side reliability fix ensuring getURL always returns an absolute URL during initial setup and development environments. It prevents broken links in email flows and authentication callbacks while remaining backward compatible with existing deployments
Summary by CodeRabbit