parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
812 stars 346 forks source link

fix: Prevent `query->count` from changing query internals #511

Closed dplewis closed 1 year ago

dplewis commented 1 year ago

New Pull Request Checklist

Issue Description

The current query->count function overrides the limit and count conditions. This prevents the query from being used after the count operation occurs and may return unintended results. This could be worked around by using withCount.

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this pull request!

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0fc3d8f) 98.62% compared to head (a0eb0ad) 98.62%.

:exclamation: Current head a0eb0ad differs from pull request most recent head 70f5f2c. Consider uploading reports for the commit 70f5f2c to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #511 +/- ## ========================================= Coverage 98.62% 98.62% Complexity 1072 1072 ========================================= Files 38 38 Lines 3264 3265 +1 ========================================= + Hits 3219 3220 +1 Misses 45 45 ``` | [Impacted Files](https://app.codecov.io/gh/parse-community/parse-php-sdk/pull/511?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community) | Coverage Δ | | |---|---|---| | [src/Parse/ParseClient.php](https://app.codecov.io/gh/parse-community/parse-php-sdk/pull/511?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community#diff-c3JjL1BhcnNlL1BhcnNlQ2xpZW50LnBocA==) | `95.31% <ø> (ø)` | | | [src/Parse/ParseQuery.php](https://app.codecov.io/gh/parse-community/parse-php-sdk/pull/511?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community#diff-c3JjL1BhcnNlL1BhcnNlUXVlcnkucGhw) | `99.76% <100.00%> (+<0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

dplewis commented 1 year ago

@mtrezza Since https://github.com/parse-community/parse-php-sdk/pull/510 got merged, I updated the tests to show query internals haven't been changed. This is ready to merge

parseplatformorg commented 1 year ago

🎉 This change has been released in version 2.3.2