Skip to content

CS-11145: regression test guarding relativizeDocument's primary-resource round-trip#4830

Draft
richardhjtan wants to merge 1 commit into
mainfrom
CS-11145-doubled-path-relativize
Draft

CS-11145: regression test guarding relativizeDocument's primary-resource round-trip#4830
richardhjtan wants to merge 1 commit into
mainfrom
CS-11145-doubled-path-relativize

Conversation

@richardhjtan
Copy link
Copy Markdown
Contributor

Summary

Investigation update for the catalog-thumbnail doubled-path 404s. Adds a focused regression test confirming the primary-resource path through relativizeDocument is symmetric for the production scenario (a CardListing with cardInfo.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:236 and then relativizeResource. Both turn out to be fine for the primary-resource path:

  • On-disk Listing card JSONs store links.self correctly as "../ListingThumbnails/foo.png".
  • The new test runs that through relativizeDocument + resolveCardReference and 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 in store.ts:loadRelationshipInstance, or a URL written into the prerendered HTML that then resolves wrong client-side. The path-arithmetic test new URL('./room-XYZ/ListingThumbnails/foo.png', '/catalog/room-XYZ/ListingThumbnails/file.json').href reproduces 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 dump boxel_index.html_format for 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 in file-def-manager.

Files

  • packages/realm-server/tests/card-reference-resolver-test.ts — one new test.

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Host Test Results

    1 files      1 suites   1h 43m 53s ⏱️
2 661 tests 2 646 ✅ 15 💤 0 ❌
2 680 runs  2 665 ✅ 15 💤 0 ❌

Results for commit d943a8f.

Realm Server Test Results

    1 files      1 suites   11m 9s ⏱️
1 366 tests 1 366 ✅ 0 💤 0 ❌
1 445 runs  1 445 ✅ 0 💤 0 ❌

Results for commit d943a8f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant