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

lexi: Unable to iterate backwards with prefix. #3161

Closed
JoeGruffins opened this issue Jan 27, 2025 · 2 comments · Fixed by #3162
Closed

lexi: Unable to iterate backwards with prefix. #3161

JoeGruffins opened this issue Jan 27, 2025 · 2 comments · Fixed by #3162

Comments

@JoeGruffins
Copy link
Member

JoeGruffins commented Jan 27, 2025

Using a prefix while iterating should only return results that start with that prefix. However something seems broken when iterating in reverse. This test should work but fails with no results in reverse. JoeGruffins@8f3b015

@buck54321
Copy link
Member

buck54321 commented Jan 27, 2025

I've been hacking at this for a while.

Here's a commit on top of @JoeGruffins commit to show how either badger ain't right, or I'm just not getting it: buck54321/dcrdex@8f3b015...buck54321:dcrdex:reverseprefixduh0

Here's a commit with an adapted fix that was offered for this issue in the badger repo. It works, but then we bomb at a different spot: buck54321/dcrdex@af271ac...buck54321:dcrdex:reverseprefixduh1

I think there's probably a solution to be cobbled together, but damn.

@buck54321
Copy link
Member

Not to make things more confusing, but I just tested reverse iteration with a prefix in #3153 (scoredIdx), and it worked fine.

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 a pull request may close this issue.

2 participants