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

Document updates produce incorrect DAG state. #1811

Closed
jsimnz opened this issue Aug 23, 2023 · 3 comments · Fixed by #1817
Closed

Document updates produce incorrect DAG state. #1811

jsimnz opened this issue Aug 23, 2023 · 3 comments · Fixed by #1817
Assignees
Labels
bug Something isn't working priority/high

Comments

@jsimnz
Copy link
Member

jsimnz commented Aug 23, 2023

Describe the problem
DAG nodes from update mutations contain more than just the fields changed, they contain all the fields defined along with the field(s) changed.

To Reproduce
Create a document, update a document, run a commit request for the composite type. Will show a commit with all fields included in the update, when it

Expected behavior
should only include the newest field(s) (delta)

Additional context
Potentially related to the LensFetcher, havent confirmed, works in 0.5.1, broken in 0.6.0

@jsimnz jsimnz added bug Something isn't working priority/high labels Aug 23, 2023
@jsimnz jsimnz added this to the DefraDB v0.7 milestone Aug 23, 2023
@AndrewSisley
Copy link
Contributor

AndrewSisley commented Aug 23, 2023

This might only affect updates via the planner/gql, as collection.Save (via an UpdateDoc test action) appears to be covered by the semi-broken looking TestQueryCommitsWithDockeyAndUpdateAndLinks. We should definitely have more tests than just this one, for both requests and collection sourced updates.

We actually have a fair few tests for this (e.g. TestQueryCommitsWithFieldNameFieldAndUpdate), it very much appears to be working via collection.Save.

We do however have no tests for gql/request updates - this does appear to be broken, and this test gap needs to be closed.

@AndrewSisley
Copy link
Contributor

Will likely fix the bug as part of #1816

@AndrewSisley AndrewSisley self-assigned this Aug 24, 2023
@AndrewSisley
Copy link
Contributor

Lens fetcher does not appear to be responsible. Leading candidate is the fetcher interface simplication.

AndrewSisley added a commit to AndrewSisley/defradb that referenced this issue Aug 24, 2023
AndrewSisley added a commit to AndrewSisley/defradb that referenced this issue Aug 24, 2023
AndrewSisley added a commit that referenced this issue Aug 24, 2023
## Relevant issue(s)

Resolves #1811

## Description

Only updates updated fields via update requests by returning a clean
document from Decode.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1811

## Description

Only updates updated fields via update requests by returning a clean
document from Decode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants