RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
290 stars 46 forks source link

DatArchive Persistence and Write Permissions #22

Closed urgent closed 4 years ago

urgent commented 4 years ago

I ran this code in the Firefox:


const archive = await DatArchive.create({
      title:"Test",
    });

console.debug(archive);

Then I copied the URL from the console, and changed my code to:

const archive = await DatArchive.load("dat://f8c1bd14267d5783a06ed7ca9d255a6ca957b4be853ec415f77cda2ce4dda7ed");
await new Promise(resolve => setTimeout(resolve, 4000));
await archive.writeFile('/test.json', 'Hello World!');

and I get:

Error: Cannot write to this archive ; Not the owner

Here's a link to glitch:

https://glitch.com/edit/#!/ralphie-line

RangerMauve commented 4 years ago

Thanks for the bug report and repro! I think it should be fixed in 0.3.4. https://github.com/datproject/sdk/releases/tag/v0.3.4

Also, you shouldn't need the delay anymore since I changed how it does the initial load.