Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring code up to speed #9

Merged
merged 19 commits into from
Nov 18, 2020
Merged

Conversation

DougAnderson444
Copy link

After having some issues with random-access-web I tried to use random-access-idb as a workaround which also was problematic, I was seeing that same issues as #6 and #7. I tried to use substack's version too, but also had issues like not being able to write after reloading the browser.

This PR is the start of trying to get this code to work flawlessly in the browser.

I brought some of the code differences between this repo and substack's which will hopefully fix some of the issues (notably #6 and possibly #7 , I haven't got that far yet, I need time to check the tests). Notably this commit. So that code is brought into this R-A-S repo in this pull.

Also the tests weren't working for me, so I edited the code so that they work with browser-run.

I made the v 1.3.0 to reflect these changes.

Hopefully there's more to come.

@DougAnderson444
Copy link
Author

The db.close() was causing problems with Corestore, Nanoresource appears to be [closing] while the next store is trying to write to it. I don't really see a need to close indexedDB anyway, and removing the close (added in the substack master branch) makes the code work. I added a TODO to follow up how we can ensure the db is open if it's been closed, but in my fork I need this to work before I have time to get to that.

For your merge consideration.

Copy link
Collaborator

@soyuka soyuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you comitted example/bundle.js which is quite huge was this by mistake?

index.js Outdated
@@ -111,12 +113,12 @@ Store.prototype._write = function (req) {
})

function write (store, offsets, buffers) {
var block
var block = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined is fine right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, yes undefined is ok. This was from earlier efforts to troubleshoot issues

package.json Outdated
@@ -32,6 +31,9 @@
"browser",
"storage"
],
"engines": {
"node": ">=12.0.0"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to remember why I added this. I re-ran the tests with the engine removed, passes all tests. So I'll remove accordingly.

@RangerMauve
Copy link

@substack Would you mind adding me as a collaborator on NPM so I can merge and publish this?

@RangerMauve
Copy link

Or add @soyuka for that matter. :P

@soyuka
Copy link
Collaborator

soyuka commented Nov 18, 2020

I can merge @RangerMauve :) I was waiting for another approval. I doubt I can bump this on npm though.

@soyuka soyuka merged commit dbbef46 into random-access-storage:master Nov 18, 2020
@soyuka
Copy link
Collaborator

soyuka commented Nov 18, 2020

Thanks @DougAnderson444 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants