fix(android): manual gateway entry for IPv6 hosts#63814
fix(android): manual gateway entry for IPv6 hosts#63814MayankSharma-ops wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes Android manual gateway entry for raw IPv6 host literals (e.g.
Confidence Score: 4/5The Kotlin fix is correct and the tests are sound, but the One P1 finding (UTF-16 encoded
|
| @Test | ||
| fun composeGatewayManualUrlWrapsBareIpv6Hosts() { | ||
| val url = composeGatewayManualUrl("::1", "18789", tls = false) | ||
|
|
||
| assertEquals("http://[::1]:18789", url) | ||
| } |
There was a problem hiding this comment.
Missing test for already-bracketed IPv6 input
The new guard host.startsWith("[") && host.endsWith("]") prevents double-bracketing, but there is no test exercising that branch. A user passing [::1] directly should produce a valid URL, not http://[[::1]]:port. Consider adding a test case for pre-bracketed input to lock in that behaviour.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/android/app/src/test/java/ai/openclaw/app/ui/GatewayConfigResolverTest.kt
Line: 481-486
Comment:
**Missing test for already-bracketed IPv6 input**
The new guard `host.startsWith("[") && host.endsWith("]")` prevents double-bracketing, but there is no test exercising that branch. A user passing `[::1]` directly should produce a valid URL, not `http://[[::1]]:port`. Consider adding a test case for pre-bracketed input to lock in that behaviour.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Line 153 in 0e3fbe7
The new .gitignore entry is committed as UTF-16LE bytes (embedded NULs), so Git does not read it as gradle-user-home/; it is effectively parsed as g, which can ignore unrelated paths while still leaving gradle-user-home/ tracked. This breaks the intended ignore behavior for local Android/Gradle artifacts and introduces a surprising global ignore side effect.
ℹ️ 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".
|
Fixed .gitignore by restoring upstream version (removes encoding issue) |
336dce7 to
dc74a8a
Compare
Summary
::1Testing
GatewayConfigResolverTest