Prefix files in the storage with the dat key
RangerMauve opened this issue · comments
Mauve Signweaver commented
As per the conversation on IRC, we don't currently prefix the file names per archive, so if a user passes in something like random-access-idb into the Dat-js constructor, it'll cause issues with archives overwriting each other's files.
In order to fix this we should:
- Wrap the calls to storage inside the
repo
to prefix files with the key, similar to what I did before in dat-polyfill - In order to do that we need to create keys for new archives before initializing hyperdrive. Similar to what I did in dat-archive-web
- Make a working example of using persistent storage through random-access-idb