~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

The iOS app sends a + in a query as a +, so a +page.svelte diff loads

Open
Open chadtmiller.com wants to merge into main from chadtmiller.com/knotless:ios/plus-in-queries

In the iOS app, a pull touching a SvelteKit route file such as +page.svelte showed "This file's diff didn't load." The app sent the + unescaped and the server read it as a space. A small fix in how the app builds query URLs; a quick look is enough.

Claude Opus 5.5 · low

What changes

Client. A new Client.url(_:_:) builds a URL from a base and query items, then escapes + as %2B. Client.query uses it, so every XRPC query the app makes is covered, getPullDiff's paths among them.

Other queries. The live run stream (RunViews.follow, _live/check), attachments (MarkdownPlace.attached) and the handle typeahead build their URLs through it too.

Why

URLComponents.queryItems percent-encodes most characters but leaves +, which is legal in a query. Axum's Query (serde_urlencoded) decodes + as a space, so paths=web/src/routes/start/+page.svelte asked for web/src/routes/start/ page.svelte. getPullDiff returned no files and FileSection.load() set failed. The server returned this file's diff fine through MCP, which is how this was narrowed to the app. This is a different bug from f0ae8e07a (diffs that were cancelled by scrolling off screen).

How it was checked

Read the server's Query<Params> extraction and confirmed the diff the app asked for exists. ios.yml runs on this pull. The app itself was not built here (Xcode needs macOS).

Shortcomings

There's no regression test: FlowTests run against recorded answers, which skip the URL building entirely, and the app has no unit test target. Worth building and opening the pull Getting started clones over https, and the docs index is whole in the app to confirm.

chadtmiller.com added 1 commit
Approved an earlier version

This adds Client.url(_:_:), which builds the query with URLComponents and then rewrites + to %2B in the encoded query. Client.query, the typeahead, attachments and the live run stream all use it now. The fix looks correct. URLComponents already encodes a literal space as %20 and a literal % as %25, so the only + left in the encoded string is a real one from a value. The replacement can't double-encode anything. No change file is needed, since the check rule only covers crates/knotless/src and crates/knotless-mcp/src. I couldn't build the iOS app here. The author's note is right that the pull should be opened in the app to confirm.

chadtmiller.com added 1 commit
Approved

The change since my approval only touches MarkdownPlace.attached. It now builds the URL inline with URLComponents and applies the same + to %2B rewrite as Client.url. That is correct, and the behaviour matches the earlier version. The duplicated rewrite is minor, and the comment names where it comes from. I couldn't build the app here.

Approved

1 approval

All checks have passed

3 passed, 5 skipped