Skip to content

fix: Parse.Query.findAll not returning all objects with option json: true #2449

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

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Feb 13, 2025

Pull Request

Issue

Using json true option on findAll caps the results at the limit or batchSize option.
This is because results[results.length - 1].id the returned objects don't have id causing the loop to break.

Approach

  • Refactor query creation for future query operations
  • Handle query for json: true
  • Improve tests

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

parse-github-assistant bot commented Feb 13, 2025

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b69233f) to head (569f477).
Report is 22 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2449   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6271      6256   -15     
  Branches      1450      1478   +28     
=========================================
- Hits          6271      6256   -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dplewis dplewis changed the title fix: Parse.Query.findAll not returning all objects with `json: true… fix: Parse.Query.findAll not returning all objects with json option Feb 13, 2025
@mtrezza mtrezza changed the title fix: Parse.Query.findAll not returning all objects with json option fix: Parse.Query.findAll not returning all objects with option json: true Feb 13, 2025
@dplewis dplewis requested a review from a team February 13, 2025 23:22
Signed-off-by: Manuel <[email protected]>
@mtrezza mtrezza merged commit f160b8c into parse-community:alpha Feb 14, 2025
10 checks passed
@mtrezza mtrezza removed the request for review from a team February 14, 2025 14:07
parseplatformorg pushed a commit that referenced this pull request Feb 14, 2025
# [5.3.0-alpha.6](5.3.0-alpha.5...5.3.0-alpha.6) (2025-02-14)

### Bug Fixes

* `Parse.Query.findAll` not returning all objects with option `json: true` ([#2449](#2449)) ([f160b8c](f160b8c))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-alpha.6

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 14, 2025
@dplewis dplewis deleted the findall-json branch February 16, 2025 01:38
parseplatformorg pushed a commit that referenced this pull request Mar 2, 2025
# [6.0.0](5.3.0...6.0.0) (2025-03-02)

### Bug Fixes

* `Parse.Hooks` requests have double forward slash in URL ([#2441](#2441)) ([1fc520c](1fc520c))
* `Parse.Query.findAll` not returning all objects with option `json: true` ([#2449](#2449)) ([f160b8c](f160b8c))
* Cannot pass `useMasterKey: false` to `Parse.Cloud.run` ([#2431](#2431)) ([abadac9](abadac9))
* Remove validation error handler option `error` from various methods of `Parse.Object` ([#2445](#2445)) ([52ddaee](52ddaee))
* Security upgrade dset from 3.1.3 to 3.1.4 ([#2277](#2277)) ([058f8e4](058f8e4))

### Features

* Add transaction to save and destroy on `Parse.Object` ([#2265](#2265)) ([2b55bdf](2b55bdf))

### BREAKING CHANGES

* Internal REST requests for `Parse.Hooks` use a URL that contains a double forward slash, for example `http://localhost/parse//hooks/functions`. This release changes the double forward slash to a single forward slash. ([1fc520c](1fc520c))
* Removes the error handler option `error` from `Parse.Object.set`, `Parse.Object.setACL`, `Parse.Object.unset`, `Parse.Role.setName` and instead throws on validation error. Previously, if the `error` option was set, the handler was invoked if a validation error occurred on `Parse.Object.set`, and if no handler was set, an error was thrown on `Parse.Object.save`. The new behavior is that an error is thrown at `Parse.Object.set`. For example, instead of using `Parse.Object.set(key, value, { error: ... })` wrap `Parse.Object.set(key, value)` into a `try/catch` block. ([52ddaee](52ddaee))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants