Firestore Query Warning with "price" equality filter and OrderBy set to the same "price" field
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, kotlin
- Domain
- databases, mobile-dev
Research direction
Start at the custom FirestoreAdapter and the Filter Dialog, then reproduce the case where a particular price is filtered and sorting is also set to price. Done means this combination no longer produces the reported Firestore warning, with price sorting disabled when that equality filter is selected.
Written by the indexing model from the issue text.
Description
Following warning is reported by our custom FirestoreAdapter, when a user chooses to filter by a particular price and then sorts the results by price in the Filter Dialog-
2021-03-21 23:29:04.761 7574-7574/? W/FirestoreAdapter: onEvent:error
com.google.firebase.firestore.o: INVALID_ARGUMENT: Order by clause cannot contain a field with an equality filter price
at com.google.firebase.firestore.p0.b0.k(Unknown Source:22)
at com.google.firebase.firestore.k0.o.b(Unknown Source:30)
at com.google.firebase.firestore.k0.o0.r(Unknown Source:41)
at com.google.firebase.firestore.k0.o0.c(Unknown Source:83)
at com.google.firebase.firestore.k0.g0$b.c(Unknown Source:6)
at com.google.firebase.firestore.o0.m0.D(Unknown Source:69)
at com.google.firebase.firestore.o0.m0.s(Unknown Source:55)
at com.google.firebase.firestore.o0.m0.d(Unknown Source:0)
at com.google.firebase.firestore.o0.m0$a.e(Unknown Source:2)
at com.google.firebase.firestore.o0.t0.u(Unknown Source:21)
at com.google.firebase.firestore.o0.t0.n(Unknown Source:2)
at com.google.firebase.firestore.o0.b$c.g(Unknown Source:42)
at com.google.firebase.firestore.o0.d.run(Unknown Source:4)
at com.google.firebase.firestore.o0.b$a.a(Unknown Source:21)
at com.google.firebase.firestore.o0.b$c.d(Unknown Source:6)
at com.google.firebase.firestore.o0.t$a.c(Unknown Source:2)
at e.a.k1.p$e$b.b(Unknown Source:40)
at e.a.k1.p$e$b.a(Unknown Source:18)
at e.a.k1.x.run(Unknown Source:6)
at e.a.k1.z1.run(Unknown Source:11)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.p0.g$c$b.run(Unknown Source:15)
at java.lang.Thread.run(Thread.java:929)
Caused by: e.a.e1: INVALID_ARGUMENT: Order by clause cannot contain a field with an equality filter price
at e.a.d1.c(Unknown Source:2)
at com.google.firebase.firestore.p0.b0.k(Unknown Source:0)
at com.google.firebase.firestore.k0.o.b(Unknown Source:30)
at com.google.firebase.firestore.k0.o0.r(Unknown Source:41)
at com.google.firebase.firestore.k0.o0.c(Unknown Source:83)
at com.google.firebase.firestore.k0.g0$b.c(Unknown Source:6)
at com.google.firebase.firestore.o0.m0.D(Unknown Source:69)
at com.google.firebase.firestore.o0.m0.s(Unknown Source:55)
at com.google.firebase.firestore.o0.m0.d(Unknown Source:0)
at com.google.firebase.firestore.o0.m0$a.e(Unknown Source:2)
at com.google.firebase.firestore.o0.t0.u(Unknown Source:21)
at com.google.firebase.firestore.o0.t0.n(Unknown Source:2)
at com.google.firebase.firestore.o0.b$c.g(Unknown Source:42)
at com.google.firebase.firestore.o0.d.run(Unknown Source:4)
at com.google.firebase.firestore.o0.b$a.a(Unknown Source:21)
at com.google.firebase.firestore.o0.b$c.d(Unknown Source:6)
at com.google.firebase.firestore.o0.t$a.c(Unknown Source:2)
at e.a.k1.p$e$b.b(Unknown Source:40)
at e.a.k1.p$e$b.a(Unknown Source:18)
at e.a.k1.x.run(Unknown Source:6)
at e.a.k1.z1.run(Unknown Source:11)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.p0.g$c$b.run(Unknown Source:15)
at java.lang.Thread.run(Thread.java:929)
Looks like we need to disable the sort option on price when a particular price is selected by the user.
- Dominant language
- Kotlin
- Stars
- 295
- Forks
- 168
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/friendlyeats-android
-
Rewrite your codelab Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
firebase/friendlyeats-android#227 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
firebase/friendlyeats-android#220 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
firebase/friendlyeats-android#212 ·
-
needs-info
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
firebase/friendlyeats-android#141 · 3 comments ·
-
needs-info
Difficulty 4/5 3-5 days Newbie friendliness 25/100
firebase/friendlyeats-android#129 · 3 comments · 1 reaction ·
All issues in firebase/friendlyeats-android
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Anthonyy232/Paperize#614 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
helsemelding-json-schema json-schema-core
Difficulty 2/5 1-3 hours Newbie friendliness 68/100