-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
count() is incorrect #4755
Comments
We need a PR with a test for that. This would make it easy to check if this is a dexie.js problem or if other storages are also affected. |
Oh... it has failed; https://github.com/pubkey/rxdb/actions/runs/5245370737/jobs/9472723197 (I'm guessing this job is the closest to my usage but I'm not 100% sure) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. |
keep open |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. Notice that only bugs in the rxdb premium plugins are ensured to be fixed by the maintainer. Everything else is expected to be fixed by the community, likely you must fix it by yourself. |
This is still an issue as far as I know. I can't today but I'll test again with the latest version when I get a chance |
Hi @adam-lynch |
Ok great |
@adam-lynch |
I checked again using my tests and the example I described (using Example: I have 4 items total. 2 of which have IDs that start with |
@adam-lynch I tried to reproduce this but couldnt. https://github.com/pubkey/rxdb/pull/4829/files |
I'll try to make a simpler test on my end. The test I used today uses |
I tried a few other things too including disabling event reduce, disabling key compression, adding a cache replacement policy which always uncaches all, disabled validation, etc. I don't know how I can debug this any further. I tried stepping through but I don't understand it all. I don't see anywhere that the regex I give is converted into a query/plan. It seems like it just sets the bounds and counts. |
@adam-lynch
Did you set
This is interesting and helps a bit in debugging. |
I'll try now.
Yes.
|
Test: #4843. Interestingly when I run this test locally, the |
@adam-lynch Thank you, the test helped. |
Thanks, I'll test on Monday |
Looks good, thanks |
In our web app, we do this:
Expected:
result
is0
.Actual:
result
is1
.In fact, if I use the following code instead...
...
result
is0
. (That's the exact same query)Data
The collection does contain one item with an ID of
persistentStateBlob2
.Schema
Versions and storage
What I've tried
### With our app
eventReduce
.multiInstance
.All behave the same.
RxDB tests
test/unit/bug-report.test.ts
and ran it with node+dexie; it passed.count matching only
test intest/unit/rx-collection.test.ts
and ran it with node+dexie; it passed.Other notes
count(...)
(with a selector) correctly returns0
if the collection is empty.count()
without any argument seems correct.The text was updated successfully, but these errors were encountered: