Skip to content

Resolve module identifier with @cardstack/catalog/ prefix#4296

Merged
tintinthong merged 2 commits intomainfrom
fix-card-type-service
Apr 2, 2026
Merged

Resolve module identifier with @cardstack/catalog/ prefix#4296
tintinthong merged 2 commits intomainfrom
fix-card-type-service

Conversation

@tintinthong
Copy link
Copy Markdown
Contributor

@tintinthong tintinthong commented Apr 1, 2026

This affects LHS when we open a module

Screenshot 2026-04-01 at 2 45 01 PM

It seems this is activated when opening a card that imports @cardstack/catalog/prefix from the type-chain somehow. Either LHS or RHS

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dfcd0a11c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let moduleInfo =
this.moduleInfoCache.get(moduleIdentifier) ??
(await this.fetchModuleInfo(new URL(moduleIdentifier)));
(await this.fetchModuleInfo(cardIdToURL(moduleIdentifier)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize moduleInfoCache lookup key before fetch

When moduleIdentifier is a prefix-form ID like @cardstack/catalog/..., this new cardIdToURL(moduleIdentifier) call resolves it to an absolute URL, but the cache lookup still uses the original prefix string. fetchModuleInfo() stores entries under url.href, so prefixed modules will never hit moduleInfoCache and will re-fetch module metadata for each type assembled from the same module. This introduces avoidable network requests and can noticeably slow type assembly in flows that load multiple definitions from one prefixed module.

Useful? React with 👍 / 👎.

@tintinthong tintinthong requested a review from a team April 1, 2026 06:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Preview deployments

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Realm Server Test Results

  1 files  ±0    1 suites  ±0   12m 37s ⏱️ +34s
828 tests ±0  828 ✅ ±0  0 💤 ±0  0 ❌ ±0 
899 runs  ±0  899 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d56f985. ± Comparison against base commit e6f2b06.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Host Test Results

    1 files  ± 0      1 suites  ±0   2h 15m 9s ⏱️ -7s
2 095 tests +24  2 080 ✅ +25  15 💤 ±0  0 ❌ ±0 
2 095 runs  +24  2 080 ✅ +26  15 💤 ±0  0 ❌  - 1 

Results for commit d56f985. ± Comparison against base commit e6f2b06.

This pull request removes 1 and adds 25 tests. Note that renamed tests count towards both.
Chrome ‑ error
Chrome ‑ Integration | serialization > base cards > EthereumAddressField: can deserialize field
Chrome ‑ Integration | serialization > base cards > EthereumAddressField: can serialize field
Chrome ‑ Integration | serialization > base cards > EthereumAddressField: queryable value
Chrome ‑ Unit | auth-error-guard: card errors with auth statuses are recognized without event flag
Chrome ‑ Unit | auth-error-guard: middleware emits auth error events that cancel in-flight requests
Chrome ‑ Unit | getTypeRefsFromFilter: collects refs from nested EveryFilter inside AnyFilter
Chrome ‑ Unit | getTypeRefsFromFilter: complex: EveryFilter combining CardTypeFilter, NotFilter, and nested AnyFilter
Chrome ‑ Unit | getTypeRefsFromFilter: double negation (NotFilter inside NotFilter) restores negated: false
Chrome ‑ Unit | getTypeRefsFromFilter: returns negated result from NotFilter containing a CardTypeFilter
Chrome ‑ Unit | getTypeRefsFromFilter: returns negated results from NotFilter wrapping an AnyFilter with multiple types
…

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

@richardhjtan richardhjtan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix works without error coming from the LHS inspector

Copy link
Copy Markdown
Contributor

@habdelra habdelra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never ending....

@tintinthong tintinthong force-pushed the fix-card-type-service branch from 1dfcd0a to d56f985 Compare April 2, 2026 01:43
@tintinthong
Copy link
Copy Markdown
Contributor Author

tintinthong commented Apr 2, 2026

For future reference,

  1. for instances the lhs doesn't load
Screenshot 2026-04-02 at 09 39 58
  1. for modules,
Screenshot 2026-04-02 at 09 49 00

@tintinthong tintinthong merged commit 4acc0f1 into main Apr 2, 2026
56 of 57 checks passed
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.

3 participants