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

always write index data for VDR, never check on duplicate #2141

Merged
merged 4 commits into from
May 15, 2023

Conversation

woutslakhorst
Copy link
Member

@woutslakhorst woutslakhorst commented May 10, 2023

fixes #2140

One of the problems is that a TX ref is missing in the VDR, but it's content is applied. Now the doc can't get updated anymore. Always writing the TX ref first will resolve that problem. Other problems may still exist....
Backport to master and other V5 versions.

It has been tested by a vendor, seems to resolve the issue of a broken VDR!

Copy link
Member

@gerardsn gerardsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with some comments these files would be a lot easier to review

@@ -75,35 +75,35 @@ func (tl *store) Configure(_ core.ServerConfig) (err error) {
// Add inserts the document version at the correct place and updates all later versions if needed
// The integrity of the document has already been checked by the DAG.
func (tl *store) Add(didDocument did.Document, transaction Transaction) error {
// prevents parallel execution
err := tl.db.Write(context.Background(), func(tx stoabs.WriteTx) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this split in 2 write operations?

}
if err = applyFrom(tx, base, applyList); err != nil {
return fmt.Errorf("applying event list failed: %w", err)
}
}
return writeEventList(tx, currentEventList, didDocument.ID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it writing the eventList if it has not been changed?

@beardedfoo
Copy link
Contributor

with some comments these files would be a lot easier to review

My feedback would be the same. Adding some lengthy comments about why we are doing these inserts etc., what we're trying to work around, etc. would be good.

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.

3 participants