mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
`amethyst+walletconnect:dlnwc?value=...` came back as "Amethyst received a URI to open but that uri was invalid", while the `//` spelling of the very same link worked. isWalletConnectRoute() accepts three spellings; only two survived the parse behind it. A uri whose scheme is followed by anything but `/` is *opaque* to java.net.URI: it reports no query at all and folds `dlnwc?value=...` into one scheme-specific part. The linux actual of UriParser -- a hand-rolled parser -- looks for `?` wherever it sits, so the actuals disagreed and the JVM one was the one losing data. Nip47DeepLink.parseCallbackValue rides the same call, so NWC callbacks were exposed to it too. The query is now recovered from the scheme-specific part when the uri is opaque. The fragment needs no such rescue: java.net.URI does parse `#...` off an opaque uri, and a test pins that. UriParserTest states the contract for every actual. The existing UriToRouteTest only covered the bare `dlnwc?value=` form -- the spelling that already worked -- which is how this went unnoticed; it now covers all three, and fails on the one-colon form without this change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>