Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a relation from secondary side does not work #3102

Closed
AndrewSisley opened this issue Oct 4, 2024 · 0 comments · Fixed by #3124
Closed

Updating a relation from secondary side does not work #3102

AndrewSisley opened this issue Oct 4, 2024 · 0 comments · Fixed by #3124
Assignees
Labels
area/collections Related to the collections system bug Something isn't working
Milestone

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented Oct 4, 2024

Providing a new docID fails with an error as documented by TestMutationUpdateOneToOne_RelationIDToLinkFromSecondarySide. Setting the id field to "" returns malformed document ID, missing either version or cid. Setting the id field to null panics.

UPDATE: We will resolve this by removing the ability to mutate the relationship from the secondary side.

@AndrewSisley AndrewSisley added bug Something isn't working area/collections Related to the collections system labels Oct 4, 2024
@AndrewSisley AndrewSisley self-assigned this Oct 4, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.14 milestone Oct 4, 2024
ChrisBQu pushed a commit to ChrisBQu/defradb that referenced this issue Feb 21, 2025
…#3124)

## Relevant issue(s)

Resolves sourcenetwork#3102

## Description

Prevents mutations from secondary side of relation.

Also validates that values given to relation fields are actually valid
docIDs - previously it only validated this on the secondary side, and it
was as easy to introduce it to the primary side as it was to correct the
tests expecting the failure, so I've added this here.

As IDs set via secondary affected the secondary docID the order of
results in some tests have changed. Also changed are tests that
accidentally created docs via the secondary side that didn't test the
secondary mutation (e.g. a lot of tests testing queries from the
secondary side also created the test docs from this direction).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collections Related to the collections system bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant