-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue where filtered queries fail on updated fields #409
Conversation
The problem is in this sub-select SQL query: AND EXISTS (
SELECT
operation_fields_v1.value
FROM
operation_fields_v1
WHERE
operation_fields_v1.name = 'username'
AND
operation_fields_v1.value = $1
AND
operation_fields_v1.operation_id = document_view_fields.operation_id
) It filters all fields out which do not fulfill this requirement (username = $1), even when they belong to the same document .. I've made a test against the same query with filter but without UPDATE operations in the document and it works. |
So it is filtering out the other document fields, which we actually might want (depending on the selected fields)? |
Exactly! The problem was that we just filtered document fields, but actually we wanted to filter document views which contain that document field. I extended the sub query now with a JOIN to reflect this. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
+ Coverage 92.58% 92.64% +0.05%
==========================================
Files 70 70
Lines 6652 6660 +8
==========================================
+ Hits 6159 6170 +11
+ Misses 493 490 -3
☔ View full report in Codecov by Sentry. |
Closes #379
📋 Checklist
CHANGELOG.md