-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
liveQuery doesn't update for an orderBy on certain compound indexes (perhaps PK or autoincrement related?) #1946
Comments
As an aside, I came across this problem when using a pattern similar to that described at https://stackoverflow.com/a/77329694/22644904 For a table where I have a need for a certain seldomly-touched subset of fields, and where I want db.myTable.orderBy("[orderIndex+field2+field3]"). /*... SNIP ... */ (I happen to want the results ordered by Of course, this requires an additional compound index on the table, but I figured that's cheaper than any alternative that I know of. My question is: If I'm scared of As an aside to the aside, my fear of |
…it for good. (#2096) Co-authored-by: David Fahlander <david@dexie.org>
Demo: https://codesandbox.io/p/sandbox/zealous-mopsa-9qx3vp
Take for example:
liveQuery
that does a simpletoArray()
on thethings
table auto-updates when a new item is added tothings
liveQuery
that doesorderBy("colour").toArray()
auto-updatesliveQuery
that doesorderBy("[colour+number]")
auto-updatesliveQuery
that doesorderBy("[colour+id]")
does not auto-updateliveQuery
that doesorderBy("[colour+id+number]")
does not auto-updateThis reproduces under 4.0.1. I was also seeing symptoms of it from a recent release of 3, from which I updated to 4 hoping it would be resolved. When it wasn't I put the rough but honest codesandbox reproducer together.
Am I doing something wrong? Or is there a bug with the auto-updating of
liveQuery
, perhaps when the PK and/or an auto-incremented index is involved in a compound index?I had a quick look and I couldn't find an existing issue for this.
The text was updated successfully, but these errors were encountered: