Skip to content
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

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

Merged
merged 4 commits into from
May 13, 2023

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented May 12, 2023

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
Copy link

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.

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

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

❗ 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
@@            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 Coverage Δ
src/Parse/ParseClient.php 95.31% <ø> (ø)
src/Parse/ParseQuery.php 99.76% <100.00%> (+<0.01%) ⬆️

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

@dplewis dplewis requested a review from mtrezza May 12, 2023 19:28
mtrezza
mtrezza previously approved these changes May 13, 2023
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@dplewis
Copy link
Member Author

dplewis commented May 13, 2023

@mtrezza Since #510 got merged, I updated the tests to show query internals haven't been changed. This is ready to merge

@dplewis dplewis requested a review from mtrezza May 13, 2023 15:27
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mtrezza mtrezza merged commit 26db002 into parse-community:master May 13, 2023
parseplatformorg pushed a commit that referenced this pull request May 13, 2023
## [2.3.2](2.3.1...2.3.2) (2023-05-13)

### Bug Fixes

* Prevent `query->count` from changing query internals ([#511](#511)) ([26db002](26db002))
@parseplatformorg
Copy link

🎉 This change has been released in version 2.3.2

@parseplatformorg parseplatformorg added the state:released Released as stable version Edit label May 13, 2023
@dplewis dplewis deleted the count-conditions branch June 13, 2024 19:47
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 Edit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants