decentralized-identity / decentralized-identity/dwn-sdk-js
Investigate and fix unwanted storage of junk/invalid data in `DataStoreLevel` implementation
- Dominant language
- TypeScript
- Stars
- 322
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
There appears a bug in `DataStoreLevel.put()` implementation where if there exists a piece of data with `dataCid` X in the store, and another `put()`is called with the same `tenantId` and `dataCid` X but incorrect data stream, this incorrect data would be stored indefinitely as chunks.
A potential way to fix this is to:
1. push the `dataCid` check currently done by the caller of `put()` into `put()` itself.
2. attempt to see if an existing data with `dataCid` X is in the store, if in this store, then read the data stream into a temporary location (to be deleted later). If not in the store, then proceed to happy/common path (also require code tweaks in this path.
3. validate the dataCid of data in temporary location and react accordingly.
Contributor guide
Assessment
This issue has not been assessed yet.