Conversation
… paths HasMaxDepth matched every path that starts with the property name, so HasMaxDepth on Address also applied to AddressBackup.State. A path could skip the global MaxPropertyDepth if its name started with a property that has a looser limit. Match the property name or the name followed by a dot. BREAKING CHANGE: HasMaxDepth on a property no longer applies to another property whose name starts with the same text. That property uses the global MaxPropertyDepth.
pdevito3
force-pushed
the
fm/qk-breaking-max-depth-prefix
branch
from
October 1, 2026 21:46
52b1ef0 to
23cde7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 prefix match to keep v1.x compatible (restore commit
a947ebb). This PR re-applies73523a5(#113). The captain decides on this PR separately.Summary
HasMaxDepthapplies only to the property and the paths below it. The lookup ignores the letter case, as before.v1.14.2 behavior (and main)
HasMaxDepthapplies to every path that starts with the property name as text.HasMaxDepthonAddressalso applies toAddressBackup.Stateand toAddressLines.New behavior
HasMaxDepthonAddressapplies toAddressand toAddress.<anything>. A different property such asAddressBackupuses the globalMaxPropertyDepth.Example
AddressBackup.Stategets the limit of 1 fromAddress.QueryKitPropertyDepthExceededException("depth of 1 ... maximum allowed depth of 0").Security risk on v1.14.2
MaxPropertyDepthlimits how deep a caller can go into the object graph. With the prefix match, a path skips the global limit if its name starts with the name of a property that has a looserHasMaxDepth. A caller can then reach navigation properties that the global limit was set to block. This can expose related data and make larger joins than the app permits.Justification
HasMaxDepthis configured on one property. It must not change the limit of a different property that has a similar name. The new match uses the property path, not the text prefix.Migration
If a property needs a looser limit, add
HasMaxDepthon that property.README
The Max Property Depth section now tells that the override applies only to the property and the paths below it, with the
AddressBackup.Stateexample.Tests
These tests come back from main before #134, in
PropertyDepthTests:filter_per_property_max_depth_applies_to_a_property_that_starts_with_its_name->filter_per_property_max_depth_does_not_apply_to_a_property_that_starts_with_its_namesort_per_property_max_depth_applies_to_a_property_that_starts_with_its_name->sort_per_property_max_depth_does_not_apply_to_a_property_that_starts_with_its_namedotnet test: 470 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main (#169). The rebase had no conflicts. The breaking change did not change.