Closed eu1444 closed 1 year ago
After talking with @joehand it looks like the issue is that I wasn't waiting for the 'content' event to be emitted from the archive. The README.md might need to be updated to reflect this. The documentation shows calling archive.checkout(version).download()
as the way to download a checked out archive but given the errors I encountered this is not correct.
Were you able to resolve this @mistersdevelopment? If so, would you mind sharing your code so the documentation could be updated?
I'm struggling with the version downloads atm too.
Hey @chartgerink, I believe waiting for the content event (https://github.com/mafintosh/hyperdrive/blob/master/index.js#L127) helped but I can't find any documentation of that in the test scripts I kept around so I don't have any code to share. Sorry about that.
I am reporting:
Bug Report
Please give us details about your installation to assist you. Run
dat -v
to see the version of Dat you are using.Expected behavior
I have a gist (https://gist.github.com/mistersdevelopment/4dcb5d98efbe3f48233d08bc0254c7be) that generates a Dat server/client pair. The server Dat has one file making its version 1. The client Dat's archive performs a checkout of the server at version 1. I expect the client Dat's archive to now be a read only copy of the server at version 1.
Actual behavior
As the logs below show the checkout operation fails with "TypeError: Cannot read property 'download' of null".
Debug Logs