fix(next): display deleted relations and uploads in version diff views #12955
+91
−33
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.
What?
This PR fixes an issue where
relationship
andupload
fields that had their document-counterpart deleted would cause a runtime error. This happens because the version diff components expected a populated document instead of an id.Two e2e tests were also added to the existing suite to test that the diff view is reachable even after deletions.
Why?
To prevent a runtime error when viewing diffs for documents that have relationships to deleted documents.
How?
Adjusting the diff view to accommodate deleted document relations.
Fixes #12915
Before:
2025-06-24.14-01-44.mp4
After:
versions-collections-after-Posts---Payload.webm
Notes:
PopulatedRelationshipValue
toRelationshipValue
as we don't actually know if the value is populated. Such as in the case of when the doc was deleted.