Skip to content

Fix linksTo CardDef relationships degraded to file-meta type#3959

Draft
lukemelia wants to merge 3 commits intomainfrom
fix-file-meta-relationship-type
Draft

Fix linksTo CardDef relationships degraded to file-meta type#3959
lukemelia wants to merge 3 commits intomainfrom
fix-file-meta-relationship-type

Conversation

@lukemelia
Copy link
Contributor

Summary

  • When a relationship's pristine_doc was missing data.type (stale index data from before the NotLoadedValue serialization fix), loadLinks would fall through to getFile and incorrectly return file-meta type for CardDef relationships
  • Added fieldExpectsFileMeta() method that consults the field definition to determine whether a relationship targets FileDef or CardDef before trying the file index
  • Ensures relationship.data is set with the correct type even when the linked resource is unavailable

Test plan

  • Added failing test that simulates stale index data (pristine_doc missing data.type + linked instance marked deleted), verifies relationship type is 'card' not 'file-meta'
  • All 14 "card GET request" tests pass (including existing FileDef resource test)

🤖 Generated with Claude Code

lukemelia and others added 3 commits February 5, 2026 21:07
When a card's pristine_doc in the index has a linksTo relationship
without data.type (stale data from before commit 480362e) and the
linked card's instance entry is unavailable, loadLinks falls through
to getFile which incorrectly returns type "file-meta" instead of "card".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a relationship in pristine_doc was missing data.type (stale index data
from before the NotLoadedValue serialization fix), loadLinks would fall through
to getFile and return file-meta type even for CardDef relationships. This adds
a fieldExpectsFileMeta check that consults the field definition before trying
the file index, and ensures relationship.data is set with the correct type
even when the linked resource is unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lukemelia lukemelia force-pushed the fix-file-meta-relationship-type branch from 258d7ab to 5260029 Compare February 6, 2026 04:52
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   1h 45m 25s ⏱️ - 1m 15s
1 944 tests ±0  1 914 ✅  - 13  17 💤 ±0   0 ❌ ± 0  13 🔥 +13 
1 959 runs  ±0  1 916 ✅  - 26  17 💤 ±0  13 ❌ +13  13 🔥 +13 

For more details on these errors, see this check.

Results for commit 5260029. ± Comparison against base commit 4830d89.

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