-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
ca9dc7e
to
f2ea853
Compare
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
vdr/didstore/store.go
Outdated
} | ||
if err = applyFrom(tx, base, applyList); err != nil { | ||
return fmt.Errorf("applying event list failed: %w", err) | ||
} | ||
} | ||
return writeEventList(tx, currentEventList, didDocument.ID) |
There was a problem hiding this comment.
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?
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. |
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!