element-synapse/tests
Devon Hudson 08e1b63b30
Fix v12 rooms when using frozen dicts (#19235)
Fix #19233 

Synapse fails to handle events in v12 rooms when the server is run with
the `{use_frozen_dicts: True}` config.
This PR fixes the issue, and adds tests which cover room creation,
joining, and joining over federation, with both frozen and not frozen
config settings, by extending the existing `test_send_join` federation
tests.

This approach to testing was chosen as it is a simple way to get high
level integration style test coverage, without going through all our
existing tests and trying to retroactively add in coverage when using
frozen dicts.
This should provide an easy place for future room versions to extend the
suite of tests and reduce the chance of introducing subtle bugs like
this in the future.

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
2025-12-01 18:26:43 +00:00
..
api Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
app Fix lost logcontext on HomeServer.shutdown() (#19108) 2025-11-03 14:07:10 -06:00
appservice Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
config Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
crypto Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
events Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
federation Fix v12 rooms when using frozen dicts (#19235) 2025-12-01 18:26:43 +00:00
handlers Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
http Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
logging Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
media Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
metrics Move towards a dedicated Duration class (#19223) 2025-11-26 10:56:59 +00:00
module_api Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
push Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
replication Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
rest Return 400 when canonical_alias content invalid (#19240) 2025-12-01 15:24:26 +00:00
scripts Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
server_notices Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
state Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
storage Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
synapse_rust Wrap the Rust HTTP client with make_deferred_yieldable (#18903) 2025-10-02 13:00:50 -05:00
test_utils Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
types Support for room version 12 2025-08-11 16:43:45 +01:00
util Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
server.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_distributor.py Cleanly shutdown SynapseHomeServer object (#18828) 2025-10-01 02:42:09 +00:00
test_event_auth.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_mau.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_phone_home.py Move unique snowflake homeserver background tasks to start_background_tasks (#19037) 2025-10-13 10:19:09 -05:00
test_rust.py Add missing type hints to tests. (#15027) 2023-02-08 19:52:37 +00:00
test_server.py Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
test_state.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_terms_auth.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_types.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_visibility.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
unittest.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
utils.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00