This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Deduplicate the query bulding logic for all dynamic filters #2979
Merged
Conversation
This file contains 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
Deploying matrix-authentication-service-docs with Cloudflare Pages
|
sandhose
force-pushed
the
quenting/refactor-dynamic-filters
branch
from
July 16, 2024 16:04
420264a
to
26ef5c3
Compare
sandhose
force-pushed
the
quenting/refactor-dynamic-filters
branch
from
July 16, 2024 16:08
26ef5c3
to
1ca82a9
Compare
reivilibre
approved these changes
Jul 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing that, it's still verbose but at least it's all contained, it feels like a good abstraction to have!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This can be reviewd commit by commit.
This deduplicates the filtering logic for
list()
andcount()
methods (as well asfinish_bulk()
on sessions)The most special one is the "app sessions" repository, as it does a SELECT UNION on both the OAuth and compat sessions tables, so I did some logic to split an AppSessionFilter into a OAuthSessionFilter and a CompatSessionFilter.
I had to add a few new filters to the OAuthSessionFilter and CompatSessionFilter, but that's it.
I'm fairly confident that most of those filters have associated tests, and most of it was copy-pasting the existing where clauses.