-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Persist schema version at time of commit (#1055)
* Remove unused dag.GetSchemaID func * Break up long lines Will be added to shortly * BREAKING - Remove unused SchemaId prop Breaks some tests as although the property is always empty it is accounted for in CID generation. * BREAKING - Remove unused Schema.Key prop Note: The empty unused prop was used to construct some cids, removing it thus changes the cids even though it was always empty. * Replace commit schemaId with versionKey The primary driving change in this commit is the addition of SchemaVersionKey to CompositeDAGDelta in core/crdt/composite.go, this persists the schema state alongside the document change. All other changes in this commit are to facilitate this change. This commit got a bit more involved than I intended as getCollectionByVersionId was regenerating the schema id instead of taking it from the object it already had - possibly because the property on the object that it already had never actualy set the property. This got a bit awkward as the id lives on the object it is generated from - when the prop was populated on regeneration of itself it was taken into account as part of the regenerated key causing it to not match the originally (saved) key. Cids in the tests have been corrected in this commit for the production code changes in this commit and the prior BREAKING commits (to save fixing them 3 times).
- Loading branch information
1 parent
93ea57a
commit 825e749
Showing
30 changed files
with
172 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Persist schema version at time of commit | ||
|
||
A handful of changes were made to the client.SchemaDescription object which caused cid calculations to change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.