Fix MSC4222 returning full state (#17915)
There was a bug that meant we would return the full state of the room on incremental syncs when using lazy loaded members and there were no entries in the timeline. This was due to trying to use `state_filter or state_filter.all()` as a short hand for handling `None` case, however `state_filter` implements `__bool__` so if the state filter was empty it would be set to full. c.f. MSC4222 and #17888
Showing
- changelog.d/17915.bugfix 1 addition, 0 deletionschangelog.d/17915.bugfix
- synapse/handlers/message.py 3 additions, 1 deletionsynapse/handlers/message.py
- synapse/handlers/sync.py 1 addition, 1 deletionsynapse/handlers/sync.py
- synapse/storage/controllers/state.py 36 additions, 20 deletionssynapse/storage/controllers/state.py
- synapse/storage/databases/main/state.py 4 additions, 4 deletionssynapse/storage/databases/main/state.py
- synapse/storage/databases/state/bg_updates.py 2 additions, 2 deletionssynapse/storage/databases/state/bg_updates.py
- synapse/storage/databases/state/store.py 2 additions, 1 deletionsynapse/storage/databases/state/store.py
- synapse/types/state.py 10 additions, 2 deletionssynapse/types/state.py
- tests/handlers/test_sync.py 32 additions, 0 deletionstests/handlers/test_sync.py
Loading
Please register or sign in to comment