Repository navigation
Replace environment, restHost and realtimeHost with endpoint #1249
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
Open
ttypic
wants to merge
1
commit into
integration/split-6-deprecation-methods
Choose a base branch
from
integration/split-7-endpoint-option
base: integration/split-6-deprecation-methods
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+468
−432
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@coderabbitai please check how mandatory is this with respect to spec and rest of the code, check if current fix is enough, accordingly expand on the above
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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 22332
🤖 web_search executed:
Ably SDK specification REC1b2 endpoint hostname contains "::" ADR-119 IPv6; RFC 3986 IPv6 host square brackets URI authorityLength of output: 796
🏁 Script executed:
Length of output: 26775
🏁 Script executed:
Length of output: 11442
@sacOO7IPv6 bracketing is required for valid transport URLs. The current fix is sufficient for the URL-formatting defect identified above. An actual IPv6 request and connection test would add confidence, but I would not make those tests mandatory for this fix.Specification requirement
The endpoint contract supplied for this PR treats values containing
::as hostnames and preserves them unchanged. Therefore,Defaults.getPrimaryDomain("::1")returning"::1"is correct. Do not add brackets inDefaults.When a transport places that address in a URL, RFC 3986, Section 3.2.2 requires brackets:
This is a URL syntax requirement, not an optional formatting choice. I could not independently retrieve the authoritative REC1/ADR-119 text, so the Ably-specific conclusion relies on the endpoint contract supplied here.
Current implementation
I verified these paths:
HttpUtils.hostForUrlbrackets colon-containing hosts and preserves already-bracketed hosts.HttpUtils.buildURLapplies the helper when constructing REST endpoint URLs.WebSocketTransport.connectapplies the same helper before passing the URL to the WebSocket engine.URI.create(url). The OkHttp WebSocket engine passes the URL toRequest.Builder.url(url).WebSocketTransport.getHost()still returnsparams.host.The fix therefore operates at the correct boundary. It covers HTTP/HTTPS and WS/WSS without changing host comparisons. No further change to
Defaults.javais needed for this finding.Test coverage
HttpUtilsTestcovers unbracketed IPv6, already-bracketed IPv6, unchanged non-IPv6 hosts, and HTTP URL host/port parsing.The most useful small addition would be a mocked
WebSocketTransporttest that asserts the URL passed toWebSocketEngine.createcontains[::1], whilegetHost()remains"::1".Real IPv6 loopback tests would check network-engine behavior beyond URL construction. They are useful additional coverage, but the evidence available does not establish them as a specification requirement or a blocker for this formatting fix.
This assessment is source-level verification. I did not run the tests or establish end-to-end IPv6 connectivity.
You are interacting with an AI system.
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.
@coderabbitai so we are good with current changes right?
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.
@sacOO7Yes—the current changes are sufficient for this IPv6 URL-formatting issue, based on the source review.Keep
Defaults.getPrimaryDomain("::1")unchanged. The REST and WebSocket URL builders now add the required brackets.Additional WebSocket or IPv6 loopback tests are optional coverage, not blockers for this fix. This does not establish end-to-end IPv6 connectivity or approval of the entire PR.
You are interacting with an AI system.