hyperledger-archives / aries-framework-go-ext

https://wiki.hyperledger.org/display/aries
Apache License 2.0
14 stars 22 forks source link

fix: Return error when using duplicate tag names in MongoDB and CouchDB #239

Closed DRK3 closed 2 years ago

DRK3 commented 2 years ago

Put operations in the MongoDB and CouchDB operations that used the same tag name multiple times would result in all but the last usage getting lost due to the slice to map conversion that happens. With some effort, this issue may be fixable in the future, but for now I've updated the methods to return an explicit error to prevent unexpected behaviour.

Also updated golang.org/x/sys version in the mongodb module to resolve an issue when compiling with Go 1.18.

Also removed a TODO marker from the CouchDB implementation that is no longer needed.

Signed-off-by: Derek Trider Derek.Trider@securekey.com

codecov[bot] commented 2 years ago

Codecov Report

Merging #239 (e6390c8) into main (6bbd64b) will increase coverage by 4.18%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
+ Coverage   85.93%   90.12%   +4.18%     
==========================================
  Files          26        2      -24     
  Lines        3876     1296    -2580     
==========================================
- Hits         3331     1168    -2163     
+ Misses        325       81     -244     
+ Partials      220       47     -173     
Impacted Files Coverage Δ
component/storage/couchdb/store.go 88.94% <100.00%> (+0.16%) :arrow_up:
component/storage/mongodb/store.go 91.22% <100.00%> (+0.07%) :arrow_up:
component/storage/mysql/store.go
component/vdr/trustbloc/models/consortium.go
...trustbloc/config/updatevalidationconfig/service.go
component/vdr/sidetree/option.go
...nt/vdr/trustbloc/config/signatureconfig/helpers.go
...mponent/vdr/trustbloc/config/httpconfig/service.go
...nt/vdr/trustbloc/config/verifyingconfig/service.go
.../vdr/trustbloc/config/memorycacheconfig/service.go
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6bbd64b...e6390c8. Read the comment docs.