Repository navigation
[agent-cli] navigate percent-encodes the route it opens (llp/0005 §navigate) - #198
Conversation
606def1 to
613e1fa
Compare
613e1fa to
c33c4a1
Compare
| (_match, scheme: string, authority: string | undefined, rest: string) => | ||
| scheme + | ||
| encodeUrlPart(authority ?? '') | ||
| .replace(/%5B/g, '[') |
There was a problem hiding this comment.
[bug] encodeFullUrl runs .replace(/%5B/g, '[').replace(/%5D/g, ']') on the whole authority after encodeUrlPart has folded existing escapes back. That decodes brackets the caller already wrote. myapp://foo%5Bbar%5D/baz used to pass through unchanged and new URL accepts it. It is now myapp://foo[bar]/baz, which throws Invalid URL, so schemeOf skips iOS scheme approval and NSURL URLWithString: returns nil. The same replace rewrites exp://[::1%5D:8081/a into exp://[::1]:8081/a. Lowercase %5b is left alone, so only the usual uppercase form breaks.
Suggestion: Keep raw [ ] only when they wrap an IPv6 host, and protect those characters before encodeUrlPart instead of unescaping every %5B and %5D afterward. An authority that already contains %5B or %5D should stay as written.
Only an IPv6 host gets its `[` `]` back after encodeURI. Escapes the caller wrote, %5B and %5D included, stay as written. Addresses Kudo's review on #198. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vigate)
Problem (N2-12): `navigate "/street/U Zeleného stromu" --eas` failed with
APP_NOT_INSTALLED. The route went into the deep link without percent-encoding,
so every route with a space or diacritics failed. A full URL such as
`cyclable://street/U Zeleného stromu` failed the same way.
Change: resolveDeepLinkUrl encodes the route once with encodeURI, keeps
escapes the caller already wrote, and keeps URL delimiters. A full URL gets
the same encoding for its authority and for the part after it; the authority
keeps `[` `]`, so an IPv6 host such as `exp://[::1]:8081` stays a host. Its
resolution now says the full URL was only percent-encoded. One it.each table
covers routes and full URLs; one test covers the Expo Go link. The LLP states
the rule, and tags the agent-device and Expo Router claims as observed. The
changelog has a bug-fix line.
Red before: the full-URL rows "cyclable://street/U Zeleného stromu",
"demoapp://Žižkov/x", "exp://[::1]:8081/--/street/U Z",
"exp://h/--/a b?q=a b#f g", "myapp:profile/Ž", and the two full-URL
resolution tests ("myapp://profile/42", "https://example.com/profile/42").
On main, also the route rows "/street/U Zeleného stromu" (scheme and Expo Go)
and "/street/Horní?x=a b&y=1#top".
Guard: "/street/U%20Zelen%C3%A9ho%20stromu" (no double encoding),
"/discount/50%" -> "50%25", "exp://[fe80::1%25en0]:8081" (zone kept), and
"exp+cyclable://expo-development-client/?url=http%3A%2F%2F…" (unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only an IPv6 host gets its `[` `]` back after encodeURI. Escapes the caller wrote, %5B and %5D included, stay as written. Addresses Kudo's review on #198. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d72a78c to
21cd022
Compare
Problem
navigate "/street/U Zeleného stromu" --easfailed with APP_NOT_INSTALLED (dogfood N2-12, N3-36). Routes and full URLs with a space or a non-ASCII character went into the deep link unencoded.Fix
navigatepercent-encodes the route, and the authority and path of a full URL. It keeps URL delimiters, escapes the caller already wrote, and[], so an IPv6 host stays a host.🤖 Generated with Claude Code