-
Notifications
You must be signed in to change notification settings - Fork 2
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
First cut of a module to automatically change push rule actions when new users register #1
Conversation
I don't have access to the issue you linked for context, but I wonder whether we should be using the 'server-default rules' mechanism built in to push rules, perhaps exposing it as a config option? (as grim as config options can be). |
Removing the request for review because this is not actually the right way to resolve this issue. Also, @reivilibre:
What are you referring to by this? If you're suggesting allowing the config to change the server's default push rules, this sounds like a bad idea to me because
|
I've updated the module to change the push rule's actions instead of creating a new one, which is a better approach to the problem this module is trying to solve. |
This is fair enough but I wasn't sure whether this was a requirement or not without context.
The spec defines a minimal set of default rules, but specifies that homeservers are able to specify others, so I don't think this point is pertinent here.
Adding server-default push rules doesn't seem that difficult, though. It's not as though you need to hack into the way they're evaluated :). |
Yeah, I was under the impression that everyone in the Synapse team had access to that repo, but that's not the case :/
I've missed that. In this case, it might not be too bad (but in general my experience with adding "simple" things to the push rules management code of Synapse has been that it's never as simple as you initially believe it to be). (also actually ignore what I said earlier, we don't really care about changing this under the feet of existing users because it shouldn't be an actual change in UX) |
Another issue with using configurable server-side rules is that if you change them they're not automatically sent to clients of existing users, despite the new rules applying to them as well. So the notification rules would get out of sync between the clients and the server until the clients hit the "clear cache and reload" (or equivalent) button. |
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.
Looks good, assuming matrix-org/synapse#12406 lands
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.
lgtm!
This work is happening in the context of the Tchap mainlining. See https://github.com/matrix-org/matrix-dinsic/issues/856 for more information about why this specific module is needed.
The mypy failure is expected since matrix-org/synapse#12406 hasn't been released in a stable version of Synapse yet. It passes locally when using that PR's branch.
Ideally the module should check for invalid push rules at startup but implementing a push rules parser sounds like a pretty big job, and I'm not sure it'd be worth it.