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

Already on GitHub? Sign in to your account

only add new filter when not existent prevoisly #2219

Merged
merged 6 commits into from Jun 21, 2017

Conversation

Projects
None yet
3 participants
Contributor

krombel commented May 11, 2017

To avoid more filters then really needed I would like to have unique filters.
What do you think of to check before adding the new filter if we not have already have one with the same definition?

add check to only add a new filter if the same filter does not exist …
…previously

Signed-off-by: Matthias Kesler <krombel@krombel.de>

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Owner

erikjohnston commented May 15, 2017

I don't think json.dumps necessarily encodes the same dict to the exact same bytes. It'd probably be better to use encode_canonical_json which does?

@matrixbot ok to test

Contributor

krombel commented May 15, 2017

Owner

erikjohnston commented May 16, 2017

Yeah, I'd replace json.dumps(..) with encode_canonical_json(..)

Owner

erikjohnston commented May 16, 2017

(I like and approve of the idea though!)

Contributor

krombel commented May 16, 2017

I would replace json.dumps(...) with encode_canonical_json(...) in another step as it is used in other parts of synapse as well.
A simple grep over all .py-files of the repo shows, that json.dumps(...) is 66 and encode_canonical_json(...) 23 times used.

krombel added some commits Jun 21, 2017

@erikjohnston erikjohnston merged commit 71995e1 into matrix-org:develop Jun 21, 2017

3 of 4 checks passed

Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Owner

erikjohnston commented Jun 21, 2017

Thanks!

@erikjohnston erikjohnston referenced this pull request in matrix-org/dendrite Oct 10, 2017

Open

Deduplicate identical filters #298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment