Fix linksTo CardDef relationships degraded to file-meta type#3959
Draft
Fix linksTo CardDef relationships degraded to file-meta type#3959
Conversation
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>
258d7ab to
5260029
Compare
Host Test Results 1 files ±0 1 suites ±0 1h 45m 25s ⏱️ - 1m 15s For more details on these errors, see this check. Results for commit 5260029. ± Comparison against base commit 4830d89. |
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
pristine_docwas missingdata.type(stale index data from before the NotLoadedValue serialization fix),loadLinkswould fall through togetFileand incorrectly returnfile-metatype forCardDefrelationshipsfieldExpectsFileMeta()method that consults the field definition to determine whether a relationship targetsFileDeforCardDefbefore trying the file indexrelationship.datais set with the correct type even when the linked resource is unavailableTest plan
data.type+ linked instance marked deleted), verifies relationship type is'card'not'file-meta'🤖 Generated with Claude Code