Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

only add new filter when not existent prevoisly #2219

Merged
merged 6 commits into from Jun 21, 2017

Conversation

krombel
Copy link
Contributor

@krombel 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?

…previously

Signed-off-by: Matthias Kesler <krombel@krombel.de>
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

2 similar comments
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@erikjohnston
Copy link
Member

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

@krombel
Copy link
Contributor Author

krombel commented May 15, 2017 via email

@erikjohnston
Copy link
Member

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

@erikjohnston
Copy link
Member

(I like and approve of the idea though!)

@krombel
Copy link
Contributor Author

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.

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

Thanks!

@krombel krombel deleted the avoid_duplicate_filters branch April 10, 2018 22:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants