CS-11145: regression test guarding relativizeDocument's primary-resource round-trip#4830
Draft
richardhjtan wants to merge 1 commit into
Draft
CS-11145: regression test guarding relativizeDocument's primary-resource round-trip#4830richardhjtan wants to merge 1 commit into
richardhjtan wants to merge 1 commit into
Conversation
Adds a test that constructs the production scenario behind CS-11145 (a CardListing with cardInfo.cardThumbnail pointing at "../ListingThumbnails/foo.png" from a card at /catalog/room-XYZ/CardListing/...) and asserts the round-trip through relativizeDocument + resolveCardReference returns the original absolute URL. This test passes today, which confirms the primary-resource code path in relativizeDocument is symmetric — the doubled-path 404s we observe in production must originate elsewhere (the included- resource path or the host's consumer-side URL resolution). CS-11145 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
3 tasks
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.
Summary
Investigation update for the catalog-thumbnail doubled-path 404s. Adds a focused regression test confirming the primary-resource path through
relativizeDocumentis symmetric for the production scenario (a CardListing withcardInfo.cardThumbnail.links.self = "../ListingThumbnails/foo.png"). This PR is not a fix — it captures a working baseline so we don't accidentally regress the symmetric path while hunting for the real source of the doubling.Linear: CS-11145 (description updated with the deeper findings).
What we learned
The original ticket pointed at
generate-thumbnail.ts:236and thenrelativizeResource. Both turn out to be fine for the primary-resource path:links.selfcorrectly as"../ListingThumbnails/foo.png".relativizeDocument+resolveCardReferenceand gets back the right absolute URL.The bug must live in one of: the included-resource path in
relativizeResource, the host's consumer-side resolution instore.ts:loadRelationshipInstance, or a URL written into the prerendered HTML that then resolves wrong client-side. The path-arithmetic testnew URL('./room-XYZ/ListingThumbnails/foo.png', '/catalog/room-XYZ/ListingThumbnails/file.json').hrefreproduces the exact doubled URL, so the open question is where such a base + rel pair gets constructed.Next steps (out of this PR)
Local repro of
catalog:update, then dumpboxel_index.html_formatfor an affected CardListing. The literal<img src=...>value will tell us whether the bug is at HTML-bake time (may even be fixed by CS-11146 Mode B's<base href>) or at source-fetch time infile-def-manager.Files
packages/realm-server/tests/card-reference-resolver-test.ts— one new test.🤖 Generated with Claude Code