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: Query count and withCount always returning 0 #61

Merged
merged 1 commit into from
Feb 24, 2023
Merged

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Feb 24, 2023

New Pull Request Checklist

Issue Description

Query count and withCount always returns zero instead of the correct count when the SDK is configured to use GET instead of POST for queries.

A similar issue occurs when using the first query.

The workaround for older versions of ParseSwift is to configure the SDK to usingPostForQuery: true. The side-effect of the workaround is you can't cache future queries.

Approach

Always use the mutated query for getting parameters instead of the original query.

TODOs before merging

  • Add tests
  • Add entry to changelog

@cbaker6 cbaker6 linked an issue Feb 24, 2023 that may be closed by this pull request
3 tasks
@codecov
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

Merging #61 (6643354) into main (56077f0) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
- Coverage   90.46%   90.42%   -0.04%     
==========================================
  Files         164      164              
  Lines       16513    16513              
==========================================
- Hits        14938    14932       -6     
- Misses       1575     1581       +6     
Impacted Files Coverage Δ
Sources/ParseSwift/Types/Query.swift 88.56% <100.00%> (ø)
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 74.52% <0.00%> (-0.59%) ⬇️
...s/ParseSwift/Objects/ParseInstallation+async.swift 91.50% <0.00%> (-0.50%) ⬇️
Sources/ParseSwift/Objects/ParseUser.swift 88.22% <0.00%> (-0.15%) ⬇️
Sources/ParseSwift/Coding/ParseEncoder.swift 78.14% <0.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cbaker6 cbaker6 changed the title fix: query count and withCount always returning 0 fix: Query count and withCount always returning 0 Feb 24, 2023
@cbaker6 cbaker6 merged commit 9c8f139 into main Feb 24, 2023
@cbaker6 cbaker6 deleted the fixCount branch February 24, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Count not working
1 participant