-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
bytewise key-encoding on sub-level causes not found on other level #64
Comments
No issue if I switch to |
You're likely hitting a known issue with |
To confirm it's that, could you try replacing |
Yes - leveldown works. |
Great. So, reverting Level/codec#23 should fix this, the |
So, you want to revert #23, which was a revert itself? |
Yes :) |
okaydoky I'll test if that fixes my unit-test locally then do the pr. |
okay I've cherry-picked the original commit and resolved the linting errors: https://github.com/MeirionHughes/codec/commit/9f6686a390b96200a93103e6672d96569a388a2a doesn't seem to fix it unfortunately. I |
I'll see if I can make a basic failing test on here |
Okay I've managed to get it to trigger the race condition. At least for me and its consistent: https://github.com/Level/subleveldown/compare/tests/buffer-race-issue it very odd because you can change |
|
fixed - still failing. I've also made sure that my local version of level-codec with your suggested change (Level/codec@master...MeirionHughes:master) is defiantly being loaded. ... anyway I can use charwise and keep all my keys as strings for now. |
I had a closer look. Thanks for providing a clean |
We have a few options:
I hate encodings right now :) |
I think I prefer 2. Because although it is not the same behavior as @ralphtheninja WDYT? Edit: I forgot I already wrote code for 2! To deal with other surprising cases, all arising from the fact that |
Thanks for investigating, on a Sunday no-less! - Perhaps no.1 via an option so that it behaves just like leveldown? Non-breaking, but allows memdown to behave like leveldown during unit tests. I guess if you're code for no.2 already solves it then that is the way to go. |
Although it's easy to add a Somewhere this week, I'll try to clean up and push the code that I have. It will make Side note: are you using |
Opened a PR for Keeping this open though, as a reminder to test everything together once ready. |
Fixed in |
I'm getting odd behavior when using bytewise encoding on a sublevel. The intention is have bytewise encode a number to lex-sortable key, and then have that key appended on the end of the sub-level. It works if I write one value, but the moment I write a second, I can't read keys from other nested subs. Any idea where I'm going wrong? Docs says a sub-level must encode to a buffer and
bytewise
should be doing just that.Console output:
deps:
The text was updated successfully, but these errors were encountered: