-
Notifications
You must be signed in to change notification settings - Fork 0
Fix websocket host when backend returns localhost #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…nHands#11767) Co-authored-by: Lai Jinyi <laijinyi@tp-link.com.cn>
… builder (OpenHands#11816) Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
…enHands#11828) Co-authored-by: openhands <openhands@all-hands.dev>
…s#11829) Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com> Co-authored-by: Xingyao Wang <xingyao@all-hands.dev> Co-authored-by: enyst <engel.nyst@gmail.com>
…ng rendered correctly (OpenHands#11832)
Co-authored-by: openhands <openhands@all-hands.dev>
…g rendered correctly. (OpenHands#11846)
…ontent update (OpenHands#11808) Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
OpenHands#12066) Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: John-Mason P. Shackelford <jpshack@gmail.com> Co-authored-by: openhands <openhands@all-hands.dev>
…e to frontend/src/api (OpenHands#12017)
…OpenHands#12073) Co-authored-by: openhands <openhands@all-hands.dev>
…lts (OpenHands#12015) Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
…nds#10927) Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
…penHands#12082) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…event count endpoint (OpenHands#12104)
…penHands#12027) Co-authored-by: openhands <openhands@all-hands.dev>
… endpoint (OpenHands#12105) Co-authored-by: openhands <openhands@all-hands.dev>
…penHands#12095) Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ( | ||
| ["localhost", "127.0.0.1"].includes(url.hostname) && | ||
| window.location.hostname !== url.hostname | ||
| ) { | ||
| return `${window.location.hostname}${url.port ? `:${url.port}` : ""}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localhost swap uses undefined hostname when location is stubbed
The new localhost-handling branch now reads window.location.hostname, but our vitest stubs replace location with {protocol, host} (see frontend/__tests__/build-websocket-url.test.ts), leaving hostname undefined. When conversationUrl is a localhost URL in those tests, this code returns ${window.location.hostname}:${url.port}, yielding undefined:8080 and breaking the WebSocket URL assertions, so the frontend test suite will fail after this change unless the code falls back to location.host or the stubs are updated.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task