Repository navigation
fix: Type error in Parse.Query.equalTo when matching optional array - #2901
Conversation
|
🚀 Thanks for opening this pull request! ❌ Please fill out all fields with a placeholder |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughType-level updates to ParseQuery methods: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #2901 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 64 64
Lines 6235 6235
Branches 1481 1477 -4
=========================================
Hits 6235 6235 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@swittk That's a name I haven't seen in a while. Nice catch! |
|
Hi! Nice to contribute something back once in a while 😅, life's been pretty busy but this issue's been irking me for a long time, so hopefully this helps someone else too. |
The goal of OSS and contributing
I couldn't find it either or I would have done it for you |
|
@swittk Are you just adding test cases? I see you added |
|
Apologies, I forgot to commit the actual source file so when I ran to regenerate the types it simply disappeared. Should be fixed now. |
Parse.Query.equalTo to match for optional arrays
Parse.Query.equalTo to match for optional arraysParse.Query.equalTo when matching optional arrays
Parse.Query.equalTo when matching optional arraysParse.Query.equalTo when matching optional array
|
Is this ready for merge? |
|
Yes, I think so. |
## [8.1.1-alpha.5](8.1.1-alpha.4...8.1.1-alpha.5) (2026-02-11) ### Bug Fixes * Type error in `Parse.Query.equalTo` when matching optional array ([#2901](#2901)) ([8c96da9](8c96da9))
|
🎉 This change has been released in version 8.1.1-alpha.5 |
# [8.2.0](8.1.0...8.2.0) (2026-02-20) ### Bug Fixes * `Parse.Object.createWithoutData` doesn't preserve object subclass ([#2907](#2907)) ([01dc94d](01dc94d)) * `Parse.Query.and/or/nor` loosing custom class types ([#2903](#2903)) ([89fdb07](89fdb07)) * `Parse.serverURL` not accessible via global `Parse` scope ([#2917](#2917)) ([4e78681](4e78681)) * Cloud trigger type errors for void returns and subclass constructors ([#2904](#2904)) ([de9f56d](de9f56d)) * Missing or incorrect type exports ([#2909](#2909)) ([3caa4ec](3caa4ec)) * Type error in `Parse.Query.equalTo` when matching optional array ([#2901](#2901)) ([8c96da9](8c96da9)) ### Features * Add request header `X-Parse-Upload-Mode` to identify file upload as binary data via `Buffer`, `Readable`, `ReadableStream` ([#2927](#2927)) ([a66bb06](a66bb06)) * Add support for file upload as binary data via `Buffer`, `Readable`, `ReadableStream` ([#2925](#2925)) ([e42caf6](e42caf6))
|
🎉 This change has been released in version 8.2.0 |
Pull Request
Issue
For optional arrays (e.g. field?: ClassName[] ), the equalTo function has always shown a type error when we try to match, when the underlying runtime has always worked (Parse supports matching of "array contains element" natively). This only happens when the array is optional; required arrays types already allow element matching
Example
Closes: FILL_THIS_OUT
Approach
NonNullableassertion inequalTo/notEqualToallows for type-level check to ignoreundefinedwhen deciding whether the field is a ParseObject or an array, allowing for normal "array contains element" type inference same as for required arrays, things like{ fieldName: MyClass[] }.Tasks
Summary by CodeRabbit
Improvements
Tests