Repository navigation
Conversation
Derived relation queries constrain the reverse join only by the relation keys. When those keys are nonunique, other source rows can join the same targets. This duplicates results, inflates counts, breaks pagination, and allows `self` filters to match a different source. Constrain the reverse join by the complete primary key of the source model when it is available. Preserve relation-key filtering for missing or incomplete primary keys and avoid reapplying user-input transformations to hydrated binary keys.
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.
I found this while adding lazy-loading regression coverage alongside the source/rule reverse-relation deprecation fix in Icinga/icinga-notifications-web#650.
With two Icinga DB sources and two matching rules, iterating
$source->rulereturns each rule twice. The reverse join matches both sources because it is constrained only by their shared type. This also inflates counts, breaks pagination, and allows aselffilter to match a different source.Constrain the reverse join to the originating model's complete primary key. Preserve relation-key filtering when the primary key is unavailable or incomplete. Keep hydrated binary keys from being transformed again as user input.
I have not found a way to reproduce this through the current Icinga Notifications Web UI and have not checked other modules for the same defect.