Skip to content

fix(filter)!: resolve only public members - #161

Open
pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-restore-d1-d5-d1-break
Open

pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-restore-d1-d5-d1-break

Conversation

@pdevito3

@pdevito3 pdevito3 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

For later consideration in a major version. Do not merge now.

Summary

This PR brings back the public-only member lookup that the D1 restore (#155) removed. It is a breaking change, so it needs a major version. The captain decides if and when it merges.

#155 merged into main. This PR is rebased on current main and holds only the break commit. The diff reverts only the member lookup of the D1 restore.

Change

A filter segment matches only a public property or a public field, ignoring case:

  • An internal, protected, or private member is an unknown property. The filter throws UnknownFilterPropertyException.
  • A query name on a non-public member also throws UnknownFilterPropertyException.
  • With AllowUnknownProperties, a clause on a non-public member becomes True == True and does not filter.

This is the main behavior before #155, with one exception. An indexer stays an unknown property, like on current main and v1.14.2. On main before #155, an indexer threw ArgumentException. That error was a fault and not part of the public-only design, so this PR does not bring it back.

Results

Input v1.14.2 and main This PR
InternalScore > 30 (internal property) x.InternalScore > 30 UnknownFilterPropertyException
secretRank == 7 (private field) x.secretRank == 7 UnknownFilterPropertyException
Owner.InternalAlias == "Ann" filters UnknownFilterPropertyException
score > 30, query name on InternalScore x.InternalScore > 30 UnknownFilterPropertyException
secretRank > 100 with AllowUnknownProperties x.secretRank > 100 True == True
Item == "x" (indexer) UnknownFilterPropertyException UnknownFilterPropertyException

Migration

Make a member public to filter on it.

Tests

  • The D1 unit pins in QueryKit.UnitTests/PropertyResolverTests.cs now expect the public-only result. The indexer pins do not change.
  • The D1 Postgres pins in QueryKit.IntegrationTests/Tests/PropertyResolverTests.cs now expect UnknownFilterPropertyException for the internal Nickname property, and no filter from the clause with AllowUnknownProperties.
  • dotnet test: unit 469 passed, integration 297 passed, 0 failures.
  • No README section documents member visibility, so the README does not change.

Base automatically changed from fm/qk-restore-d1-d5-d1 to main October 1, 2026 20:39
A filter segment now matches only a public property or a public field, ignoring case. An internal, protected, or private member is an unknown property. This reverts the non-public lookup that the v1.14.2 restore brought back. An indexer stays an unknown property.

BREAKING CHANGE: a filter on an internal, protected, or private member now throws UnknownFilterPropertyException, also through a query name. With AllowUnknownProperties, the clause becomes True == True and does not filter. Make the member public to filter on it.
@pdevito3
pdevito3 force-pushed the fm/qk-restore-d1-d5-d1-break branch from d501fbb to 8784984 Compare October 1, 2026 21:41
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.

1 participant