After calling withCount
on Parse.Query
, findAll
returns empty array regardless of result
#2621
Open
4 tasks done
Labels
type:bug
Impaired feature or lacking behavior that is likely assumed
Uh oh!
There was an error while loading. Please reload this page.
New Issue Checklist
Issue Description
When building a query dynamically, if
withCount
is called beforefindAll
, the request payload sent over REST just looks like that for a regularfind
query withcount
—batchSize
is not sent as the limit, and no subsequent requests are sent with an object id cursor. Even if results come back, the SDK returns an empty array to the caller and fails silently. This appears to have regressed in the SDK at some point between 4.1.0 (where this was working previously) and 6.1.1 (where I encountered it), but I haven't pinpointed it further than that. Obviously if one is usingfindAll
they can just use the size of the result to get the count, but this is definitely unexpected behavior. My workaround in app code is to callwithCount
conditionally exclusive to the condition for callingfindAll
.Steps to reproduce
withCount(true)
on the queryfindAll
on the queryActual Outcome
The result is an empty array despite the results appearing in the network tab
Expected Outcome
findAll ignores
withCount
when building the query, but shapes the result to match the expectation of calling with count:{ count: number; results: Parse.Object<T>[] }
Environment
Chrome 136.0.7103.114 (Official Build) (arm64)
Parse JS SDK: 6.1.1
Parse Server: 8.2.0
Node: LTS 20.19.2
Server
Database
Client
Logs
The text was updated successfully, but these errors were encountered: