Skip to content
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

Add a default .m.rule.tombstone push rule #4867

Merged
merged 3 commits into from Apr 29, 2019

Conversation

4 participants
@turt2live
Copy link
Member

commented Mar 15, 2019

turt2live added some commits Mar 15, 2019

@turt2live turt2live requested a review from matrix-org/synapse-core Mar 15, 2019

@codecov

This comment has been minimized.

Copy link

commented Mar 16, 2019

Codecov Report

Merging #4867 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #4867   +/-   ##
========================================
  Coverage    59.57%   59.57%           
========================================
  Files          326      326           
  Lines        33921    33921           
  Branches      5597     5597           
========================================
  Hits         20209    20209           
  Misses       12298    12298           
  Partials      1414     1414
1 similar comment
@codecov

This comment has been minimized.

Copy link

commented Mar 16, 2019

Codecov Report

Merging #4867 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #4867   +/-   ##
========================================
  Coverage    59.57%   59.57%           
========================================
  Files          326      326           
  Lines        33921    33921           
  Branches      5597     5597           
========================================
  Hits         20209    20209           
  Misses       12298    12298           
  Partials      1414     1414

@turt2live turt2live removed the request for review from matrix-org/synapse-core Mar 18, 2019

@turt2live turt2live requested a review from matrix-org/synapse-core Apr 8, 2019

@turt2live

This comment has been minimized.

Copy link
Member Author

commented Apr 8, 2019

The MSC has cleared FCP, which means this is ready for actual review.

@erikjohnston

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

This won't cause clients to be told about this new push rule down sync, but OTOH presumably we don't want to bother spending the time wiring in that update functionality now?

@turt2live

This comment has been minimized.

Copy link
Member Author

commented Apr 9, 2019

I didn't realize this didn't push it down sync, but I also think that's fine. The set of clients which use push rules is very small, and I think they can easily create their own default if needed. Is it difficult to try and get it through sync?

@erikjohnston

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

TBH I'm not sure how easy it would be to do off the top of my head. Possibly a case of adding it to the push_rules_stream table for all the users ever? That might take a while though

@turt2live

This comment has been minimized.

Copy link
Member Author

commented Apr 9, 2019

I'll give it a try and see how badly I can break things

@turt2live turt2live self-assigned this Apr 9, 2019

@turt2live

This comment has been minimized.

Copy link
Member Author

commented Apr 9, 2019

I'm not sure how possible it is to do the background update (at least at my level). I can probably stumble my way through getting the update to work, however I don't have a good metric for progress or point of continuance when processing users.

Theory was to figure out all the users which need the push rule and call self.store.set_push_rule_enabled over the set, which causes the push_rules_stream to work and for the values to be updated in the push_rules_enabled table.

For progress I wanted to do some sort of lookup for who has push notifications enabled and who doesn't have an entry for .m.rule.tombstone in the table - the goal was to avoid updating push rules for the millions of bridge users which don't need it. However, trying to select who has the master rule disabled (because it is backwards) yields interesting results:

t2lsynapse=# select * from push_rules_enable where rule_id = 'global/override/.m.rule.master' and user_name = '@travis:t2l.io';
 id | user_name | rule_id | enabled
----+-----------+---------+---------
(0 rows)

t2lsynapse=# select count(*) from push_rules_enable where user_name = '@travis:t2l.io';
 count
-------
   593
(1 row)

I do have push notifications working though, and looking at another homeserver's database I can see that sometimes the push rule is there and sometimes not :(

So in summary: I think it's fine to expect clients to make their own defaults, or resync, or something for this rule because writing this background update looks painful. In practice I don't think there's very many clients which actually use push rules.

@turt2live turt2live removed their assignment Apr 10, 2019

@neilisfragile neilisfragile added this to In progress in Homeserver Task Board via automation Apr 10, 2019

@richvdh
Copy link
Member

left a comment

lgtm

@turt2live turt2live merged commit 8c5b1e3 into develop Apr 29, 2019

23 checks passed

buildkite/synapse Build #420 passed (12 minutes, 49 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 6 seconds)
Details
buildkite/synapse/isort Passed (16 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (47 seconds)
Details
buildkite/synapse/packaging Passed (17 seconds)
Details
buildkite/synapse/pep-8 Passed (51 seconds)
Details
buildkite/synapse/pipeline Passed (2 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-4 Passed (10 minutes, 36 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-5 Passed (10 minutes, 9 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-sqlite Passed (5 minutes, 2 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-4 Passed (11 minutes, 16 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (10 minutes, 44 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (6 minutes, 53 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (6 minutes, 29 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (10 minutes, 39 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (10 minutes, 39 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (6 minutes, 38 seconds)
Details
ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 899e523...677902a
Details
codecov/project 59.57% (target 0%)
Details

Homeserver Task Board automation moved this from In progress to Done Apr 29, 2019

@turt2live turt2live deleted the travis/tombstone-notif branch Apr 29, 2019

anoadragon453 added a commit that referenced this pull request Apr 30, 2019

Merge branch 'develop' into anoa/blacklist_ip_ranges
* develop: (34 commits)
  Add a default .m.rule.tombstone push rule (#4867)
  Fix infinite loop in presence handler
  changelog
  more logging improvements
  remove extraneous exception logging
  Clarify logging when PDU signature checking fails
  Changelog
  Add --no-pep-517 to README instructions
  set PIP_USE_PEP517 = False for tests
  Fix handling of SYNAPSE_NO_TLS in docker image (#5005)
  Config option for verifying federation certificates (MSC 1711) (#4967)
  Remove log error for .well-known/matrix/client (#4972)
  Prevent "producer not unregistered" message (#5009)
  add gpg key fingerprint
  Don't crash on lack of expiry templates
  Update debian install docs for new key and repo (#5074)
  Add management endpoints for account validity
  Send out emails with links to extend an account's validity period
  Make sure we're not registering the same 3pid twice
  Newsfile
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.