-
Notifications
You must be signed in to change notification settings - Fork 15
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
Browserify compatibility and updates gun to 0.9.7 #44
Conversation
@PsychoLlama people in the community were trying to get indexedDB gun-level working with browserify and this was the first working solution thanks to @zrrrzzt 's excellent calculations. |
Shoot, there is 1 failing test in only Node v6 (not v7 or v8), from my quick peek I don't think this is the browserify/indexedDB fix, I wonder if it relates to my But at the same time, it works fine in v7 and v8 which maybe isn't a me issue? |
Can you re-run the test? Tested v6.12.3 on my machine (with nvm) and everything passed |
@zrrrzzt that is the same version as the travis test so if it passed on your machine it should be fine here too. I reran it earlier, will rerun it again. Hmm. You windows? |
https://travis-ci.org/PsychoLlama/gun-level/jobs/328520960 it doesn't look like your fault, it just looks like gun isn't merging the 2 results, which is why I wonder if it is the new gun version and the current bug I'm in the middle of fixing. |
Nope. I suspect your tests tries to compare a timestamp or something else that varies. Ran a couple of tests in a row on v8.9.4 as well. Same thing. Almost random if the test fails or passes. |
Done more testing and it doesn't matter if you use gun 0.8 or 0.9.7. If run run the tests enough times they will fail. This seems to be the problem: https://github.com/PsychoLlama/gun-level/blob/master/src/spec.js#L71 If you console log out res1, res2 and value there are no errors in res1/res2 in the failing tests. However the value is not merged. If I understand correct GUN is eventual consistent and I think the failing tests are results of testing the value before the consistency. |
@zrrrzzt you are exactly correct (man, I an consistently impressed by your thoroughness of testing/debugging/assessing things!), BUT even though gun is eventually consistent there is (and should be with gun-level too) and API-level contract with the developer that IF the data has been You testing against 0.8 and 0.9.7 calms my concern a tad. IF it is Level then it could be that Level isn't replying "fast enough" to gun's default, we can experiment through changing: https://github.com/PsychoLlama/gun-level/blob/master/src/spec.js#L87 (a few lines down from the one you linked to)
This will tell If we are still getting spotty/inconsistent results, then that might suggest there is a bug in gun directly. Sorry that this issue is coming up on your commit when I know your commit isn't causing it (I'm re-running the Travis tests every once in a while). I'm still comfortable PULLING your changes and treating this as a separate issue. Can I do that? |
Yupe, look, that 2nd rerun I did today just triggered it to succeed like you said. This is still an issue (thanks for opening one with good code to test against), so I'm gonna go ahead and merge, @PsychoLlama , so we have good indexxed-DB level support, and then we need to address the #45 issue later. @zrrrzzt you are wonderful, thank you so much for contributing so much help across a wide variety of modules so far! You're great, really a shining example of Open Source. :D |
Forgot to mention I also tested the wait approach. I'll try to write similar tests for vanilla GUN (if they don't exist) and that would help you locate the bugs |
@zrrrzzt phenomenal, thank you!!! |
Adds a browser property to
package.json
and 2 browser-specific files to make the module work with browserify.