Title: fix(env): drop the getBaseUrl browser-origin fallback by waleedlatif1 · Pull Request #6221 · simstudioai/sim · GitHub
Open Graph Title: fix(env): drop the getBaseUrl browser-origin fallback by waleedlatif1 · Pull Request #6221 · simstudioai/sim
X Title: fix(env): drop the getBaseUrl browser-origin fallback by waleedlatif1 · Pull Request #6221 · simstudioai/sim
Description: Summary The window.location.origin fallback in getBaseUrl() was added in #6214 as a safety net while the real cause — the hosted env script losing its beforeInteractive strategy — was fixed in the same PR. With injection ordering restored, window.__ENV is populated before hydration, so the fallback is unreachable in any correctly configured deployment. Guessing the origin was also unsafe in the one case it could still fire. An opaque origin — a sandboxed iframe, and /chat/* is deliberately embeddable (no X-Frame-Options) — serializes to the string 'null', which is truthy. getBaseUrl() would have returned 'null' and every call site would have silently built null/api/.... A throw surfaces the misconfiguration instead of encoding it into request URLs. Restores the unconditional throw, mirrors it in the shared testing mock, and flips the two fallback tests to assert the throw (whitespace-only coverage kept). Server-side behavior is unchanged. There was never a window to fall back to, so the server always threw. Callers that already guard getBaseUrl() — getBaseDomain(), and validateCallbackUrl() via #6217 — keep their existing fail-closed paths untouched. Type of Change Bug fix Testing Full apps/sim suite: 18195 passed. The single failure is executor/handlers/pi/cloud-review-tools.test.ts, which shells out to rg via a python subprocess — ripgrep is a shell function rather than a binary on my machine, so it is an environment artifact unrelated to these files. packages/testing suite passes (39). tsc clean, bun run lint:check clean. Also ran the structural gates: check:boundaries, check:client-boundary, check:realtime-prune, check:tool-registry-boundary, check:react-query, check:utils, check:api-validation — all pass. 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)
Open Graph Description: Summary The window.location.origin fallback in getBaseUrl() was added in #6214 as a safety net while the real cause — the hosted env script losing its beforeInteractive strategy — was fixed in the...
X Description: Summary The window.location.origin fallback in getBaseUrl() was added in #6214 as a safety net while the real cause — the hosted env script losing its beforeInteractive strategy — was fixed in the...
Opengraph URL: https://github.com/simstudioai/sim/pull/6221
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:235fbe98-7749-e07c-d101-83ab3bb7f545 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9E34:FBC06:A62C8D:E5A53A:6AFB5154 |
| html-safe-nonce | fb1d689502fad9ea626ec152fafadf5f812b289f42875d1965dd226a873ec975 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTM0OkZCQzA2OkE2MkM4RDpFNUE1M0E6NkFGQjUxNTQiLCJ2aXNpdG9yX2lkIjoiNzE4NTg1MTU3NTA0MDY5MjU2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a15b2a43fb0a2bbe5f1ba4a8eab9a1678491a4ef1a104f4727136b2c222b038e |
| hovercard-subject-tag | pull_request:4197512571 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6221/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary The window.location.origin fallback in getBaseUrl() was added in #6214 as a safety net while the real cause — the hosted env script losing its beforeInteractive strategy — was fixed in the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width