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

Synapse sends empty m.push_rules account_data in initial sync #16987

Closed
t3chguy opened this issue Mar 8, 2024 · 3 comments · Fixed by #17142
Closed

Synapse sends empty m.push_rules account_data in initial sync #16987

t3chguy opened this issue Mar 8, 2024 · 3 comments · Fixed by #17142
Assignees

Comments

@t3chguy
Copy link
Member

t3chguy commented Mar 8, 2024

Description

As per title. The spec lists a number of ordered default rules which must be present, and they are via the push rules API but missing in the corresponding account_data event.

image

Steps to reproduce

  • inspect initial sync response

Homeserver

matrix.org

Synapse Version

1.102.0rc1

Installation Method

I don't know

Database

I don't know

Workers

I don't know

Platform

I don't know

Configuration

I don't know

Relevant log output

I don't know

Anything else that would be useful to know?

https://matrix-client.matrix.org/_matrix/client/v3/sync?filter=%7B%22room%22%3A%7B%22timeline%22%3A%7B%22unread_thread_notifications%22%3Atrue%2C%22limit%22%3A20%7D%2C%22state%22%3A%7B%22lazy_load_members%22%3Atrue%7D%7D%7D&timeout=0&_cacheBuster=1709907549083 for anyone wishing to sleuth logs @webdevguru_github:matrix.org

@erikjohnston
Copy link
Member

The user in question has m.push_rules set to {} in account_data table. Somehow.

The easiest fix here would be to switch things around so the calculated push rules trump whatever is in account data:

global_account_data = {
AccountDataTypes.PUSH_RULES: await self._push_rules_handler.push_rules_for_user(
sync_config.user
),
**all_global_account_data,
}

And/or make a background update to delete such entries from account_data.

We should also double check that there is no longer anyway of actually setting m.push_rules account data nowadays.

@erikjohnston
Copy link
Member

There are roughly 1.2k users on matrix.org with an m.push_rules account data, most of them have full push rules in them but some have them empty.

c.f. SELECT * FROM account_data WHERE account_data_type = 'm.push_rules';

@erikjohnston
Copy link
Member

The easiest fix here would be to switch things around so the calculated push rules trump whatever is in account data

We actually used to do this, but the condition got swapped in matrix-org/synapse#16325, so this is a regression from v1.93.0

@erikjohnston erikjohnston self-assigned this May 2, 2024
erikjohnston added a commit that referenced this issue May 16, 2024
Fixes #16987

Some old accounts seem to have an entry in global account data table for
push rules, which we should ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants