Skip to content

fix(firestore): add explicit _apply to QueryConstraint subclasses#8928

Merged
mikehardy merged 10 commits intomainfrom
query-constraint-array-issue
Mar 13, 2026
Merged

fix(firestore): add explicit _apply to QueryConstraint subclasses#8928
mikehardy merged 10 commits intomainfrom
query-constraint-array-issue

Conversation

@MichaelVerdon
Copy link
Collaborator

@MichaelVerdon MichaelVerdon commented Mar 12, 2026

Description

closes #8923

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Mar 13, 2026 3:12pm

Request Review

@MichaelVerdon MichaelVerdon marked this pull request as ready for review March 12, 2026 15:19
Comment on lines +172 to +176
_apply<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(
query: Query<AppModelType, DbModelType>,
): Query<AppModelType, DbModelType> {
return super._apply(query);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 I may be missing something, but if this (and StartEnd/EndAt/Limit/FieldFilter also) all extend QueryConstraintBase, and it extends QueryConstraint which declares:

  abstract _apply<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(
    query: Query<AppModelType, DbModelType>,
  ): Query<AppModelType, DbModelType>;

...but these implementations are really just duplicating the signature and all calling return super._apply(query) which will chain up to an empty definition....why not make the definition in QueryConstraint concrete (even if empty, just document it's a no-op ?) and then get rid of 5 duplications of the signature with empty methods

Or is there some actual affect happening when you return a call to super._apply even if the inheritance chain seems to lead to an abstract definition?

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

looks clean + minimal to me at this point, I like it

Mr @russellwheatley ?

@mikehardy mikehardy added the Workflow: Needs Second Review Waiting on a second review before merge label Mar 13, 2026
@mikehardy mikehardy merged commit f3941a0 into main Mar 13, 2026
20 of 22 checks passed
@mikehardy mikehardy deleted the query-constraint-array-issue branch March 13, 2026 17:43
@mikehardy mikehardy removed the Workflow: Needs Second Review Waiting on a second review before merge label Mar 13, 2026
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.

[🔥] Firestore: QueryConstraint subclasses missing _apply in .d.ts type definitions

3 participants