fix(playground-url): carry the share link payload in the URL fragment - #1539
Merged
joshunrau merged 1 commit intoSep 14, 2026
Conversation
Large instruments pushed the ?files= query string past the server's header limit, so opening their share links failed with HTTP 431. The fragment is never sent to the server. Query string links are still decoded, so links already shared keep working. The playground now re-renders on hashchange, since a link that differs only in its fragment does not reload the page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhcRbc5RpsQ5hb8VXqXt7K
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.
Problem
Opening a share link for a large instrument on playground.opendatacapture.org fails with
431 Request Header Fields Too Large. The lz-string payload was in the query string, which is sent to the server in the request line and exceedshttp-server's header limit (~16 KB).Fix
@opendatacapture/playground-url:encodeShareURLnow writes#files=…&label=…&fullscreen=1. The fragment is never sent to the server, so link size is no longer bound by server header limits (only by browser URL limits, ~2 MB in Chrome).decodeShareURLandisFullscreenShareURLfall back to the query string when the fragment has nofiles, so previously shared?files=links keep working.apps/playground: a link that differs only in its fragment does not reload the page, soIndexPagenow reads the URL through a newuseLocationHrefhook that re-renders onhashchange. Without it, pasting a second share link into an open tab does nothing.AGENTS.mdfiles updated.Note: links generated by this version will not load on a playground deployment that predates it (old deployments only read the query string), so the playground should be deployed alongside the package release.
Testing
playground-url): payload lands in the fragment with an empty query string; an instrument larger than a server header limit round-trips; legacy query-string links still decode, including fullscreen.?files=link loadsIndexPage)pnpm lintandpnpm testpass.testing/does not start the playground, and adding it was out of scope for this fix.🤖 Generated with Claude Code