dat-ecosystem-archive / dat-js

A pure JavaScript browser-friendly api for using dat [ DEPRECATED - see https://github.com/datproject/sdk for similar functionality. More info on active projects and modules at https://dat-ecosystem.org/ ]

Home Page:https://datproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prefix files in the storage with the dat key

RangerMauve opened this issue · comments

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