Skip to content

Fix invalid expression for total count on inverse relationship filter from resource definition #1711

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Apr 20, 2025

Conversation

bkoelman
Copy link
Member

@bkoelman bkoelman commented Apr 20, 2025

When the total count on a secondary/relationship endpoint is queried, and the primary filter originates from IResourceDefinition.OnApplyFilter, the resulting expression is invalid. Since we're using the inverse relationship here, for many-to-many the solution is to move to the proper scope. For many-to-one endpoints, we cannot solve this, so do not return a total instead of crashing.

Fixes #1671.

QUALITY CHECKLIST

@bkoelman bkoelman changed the title Fix IResourceDefinition.OnApplyFilter called on incorrect resource type Fix invalid expression for total count on inverse relationship filter from resource definition Apr 20, 2025
Copy link

codecov bot commented Apr 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.64%. Comparing base (b97fdd4) to head (ac31043).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1711   +/-   ##
=======================================
  Coverage   90.64%   90.64%           
=======================================
  Files         355      355           
  Lines       11566    11569    +3     
  Branches     1908     1909    +1     
=======================================
+ Hits        10484    10487    +3     
  Misses        706      706           
  Partials      376      376           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bkoelman bkoelman marked this pull request as ready for review April 20, 2025 08:48
@bkoelman bkoelman merged commit b0c0838 into master Apr 20, 2025
16 checks passed
@bkoelman bkoelman deleted the crashfix-total branch April 20, 2025 08:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Primary's OnApplyFilter being applied to relationship
1 participant