host: Fix Edit Template for prefix RRIs - #5846
Draft
backspace wants to merge 1 commit into
Draft
Conversation
`identifyCard` reports a module in canonical form, so for a realm reached through a registered prefix it is an identifier rather than a URL. Edit Template parsed it as a URL, which throws — selecting any card whose type lives in the base, catalog or skills realm and asking to edit its template did nothing. Pass the identifier through instead. `updateCodePath` already accepts one and resolves it, so nothing else has to change; the parse was the whole bug. An audit of the other consumers found no second instance: of the nineteen `identify` / `identifyCard` call sites in the host, this was the only one feeding a module into `new URL`. The one other place that parses a code ref's module, `serializers/code-ref.ts`, guards on the identifier being URL-shaped first. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Preview deploymentsHost Test Results 1 files 1 suites 1h 56m 46s ⏱️ Results for commit c06fd78. Realm Server Test Results 1 files 1 suites 15m 9s ⏱️ Results for commit c06fd78. For more details on these errors, see this check. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Claude explanation
`identifyCard` reports a module in canonical form, so for a realm reached through a registered prefix it is an identifier rather than a URL. Edit Template parsed it as a URL, which throws — selecting any card whose type lives in the base, catalog or skills realm and asking to edit its template did nothing.Pass the identifier through instead.
updateCodePathalready accepts one and resolves it, so nothing else has to change; the parse was the whole bug.An audit of the other consumers found no second instance: of the nineteen
identify/identifyCardcall sites in the host, this was the only one feeding a module intonew URL. The one other place that parses a code ref's module,serializers/code-ref.ts, guards on the identifier being URL-shaped first.