Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: App crash when using QueryConstraint #193

Merged
merged 4 commits into from
Feb 27, 2025
Merged

fix: App crash when using QueryConstraint #193

merged 4 commits into from
Feb 27, 2025

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Feb 27, 2025

New Pull Request Checklist

Issue Description

Closes #169

Approach

Don't use any ParseSwift.configuration parameters in a QueryConstraint since none of the constraints have the ability to wait until initialization is complete.

The default of using the equalTo query constraint now uses the $eq comparator, which can be combined with other query constraints. The limitation is for Parse LiveQuery servers <6.3.0; this constraint doesn't work, and the equalToNoComparator should be used instead. The assumption is that since Parse Server 6 is in LTS (will be out-of-LTS when Parse Server 8 is released in 2025), developers are expected to keep their servers up-to-date for security reasons and be at least Parse Server >=6.3.0. Please take a look at the API documentation for more details.

For those using Parse Server <6.3.0 an example of using equalToNoComaparator is below:

let query = Level.query(
equalToNoComparator(
key: "name",
value: "test@parse.com"
)
)

TODOs before merging

  • Update tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@cbaker6 cbaker6 linked an issue Feb 27, 2025 that may be closed by this pull request
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (54de43d) to head (6d3c27b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #193   +/-   ##
=======================================
  Coverage   91.82%   91.82%           
=======================================
  Files         179      179           
  Lines       15934    15936    +2     
=======================================
+ Hits        14632    14634    +2     
  Misses       1302     1302           

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

@cbaker6 cbaker6 merged commit 157401b into main Feb 27, 2025
13 of 14 checks passed
@cbaker6 cbaker6 deleted the fixQueryCrash branch February 27, 2025 19:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensuring initialize has returned before attempting queries.
1 participant