decentralized-identity / decentralized-identity/dwn-sdk-js

Investigate and fix unwanted storage of junk/invalid data in `DataStoreLevel` implementation

Open
#473 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.