MatrixSynapse/synapse
Eric Eastwood 7c2a78bb3b
Marker events as state - MSC2716 (#12718)
Sending marker events as state now so they are always able to be seen by homeservers (not lost in some timeline gap).

Part of [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716)

Complement tests: https://github.com/matrix-org/complement/pull/371

As initially discussed at https://github.com/matrix-org/matrix-spec-proposals/pull/2716#discussion_r782629097 and https://github.com/matrix-org/matrix-spec-proposals/pull/2716#discussion_r876684431

When someone joins a room, process all of the marker events we see in the current state. Marker events should be sent with a unique `state_key` so that they can all resolve in the current state to easily be discovered. Marker events as state

 - If we re-use the same `state_key` (like `""`), then we would have to fetch previous snapshots of state up through time to find all of the marker events. This way we can avoid all of that. This PR was originally doing this but then thought of the smarter way to tackle in an [out of band discussion with @erikjohnston](https://docs.google.com/document/d/1JJDuPfcPNX75fprdTWlxlaKjWOdbdJylbpZ03hzo638/edit#bookmark=id.sm92fqyq7vpp).
 - Also avoids state resolution conflicts where only one of the marker events win

As a homeserver, when we see new marker state, we know there is new history imported somewhere back in time and should process it to fetch the insertion event where the historical messages are and set it as an insertion extremity. This way we know where to backfill more messages when someone asks for scrollback.
2022-05-23 20:43:37 -05:00
..
_scripts hash_password: raise an error if no config file is specified (#12789) 2022-05-19 13:03:13 +00:00
api Uniformize spam-checker API, part 2: check_event_for_spam (#12808) 2022-05-23 17:27:39 +00:00
app Reload cache factors from disk on SIGHUP (#12673) 2022-05-11 13:43:22 +00:00
appservice Update mypy to 0.950 and fix complaints (#12650) 2022-05-06 12:35:20 +00:00
config Properly close providers.json file stream. (#12794) 2022-05-19 14:23:59 +00:00
crypto Bump `black` and `click` versions (#12320) 2022-04-05 11:04:28 +01:00
events Uniformize spam-checker API, part 2: check_event_for_spam (#12808) 2022-05-23 17:27:39 +00:00
federation Uniformize spam-checker API, part 2: check_event_for_spam (#12808) 2022-05-23 17:27:39 +00:00
groups Reduce the number of "untyped defs" (#12716) 2022-05-12 14:33:50 +00:00
handlers Marker events as state - MSC2716 (#12718) 2022-05-23 20:43:37 -05:00
http Make handling of federation Authorization header (more) compliant with RFC7230 (#12774) 2022-05-18 11:19:30 +01:00
logging Another batch of type annotations (#12726) 2022-05-13 12:35:31 +01:00
metrics Add config flags to allow for cache auto-tuning (#12701) 2022-05-13 12:32:39 -07:00
module_api Uniformize spam-checker API, part 2: check_event_for_spam (#12808) 2022-05-23 17:27:39 +00:00
push Update EventContext `get_current_event_ids` and `get_prev_event_ids` to accept state filters and update calls where possible (#12791) 2022-05-20 09:54:12 +01:00
replication Send `USER_IP` commands on a different Redis channel, in order to reduce traffic to workers that do not process these commands. (#12809) 2022-05-20 15:28:23 +01:00
res Fix Jinja templating error when generating thumbnail URLs. (#12510) 2022-04-20 12:03:03 -04:00
rest Discard null-containing strings before updating the user directory (#12762) 2022-05-18 11:28:14 +01:00
server_notices Add `StreamKeyType` class and replace string literals with constants (#12567) 2022-05-16 15:35:31 +00:00
spam_checker_api Uniformize spam-checker API, part 2: check_event_for_spam (#12808) 2022-05-23 17:27:39 +00:00
state Refactor `resolve_state_groups_for_events` to not pull out full state when no state resolution happens. (#12775) 2022-05-18 10:15:52 -07:00
static
storage Prevent expired events from being filtered out when retention is disabled (#12611) 2022-05-23 17:18:23 +00:00
streams Generate historic pagination token for `/messages` when no `?from` token provided (#12370) 2022-04-06 11:40:28 +01:00
util Fix `RetryDestinationLimiter` re-starting finished log contexts (#12803) 2022-05-19 20:17:10 +01:00
__init__.py Dump setuptools; correct pyproject version number (#12478) 2022-04-20 17:33:20 +01:00
event_auth.py Add a new room version for MSC3787's knock+restricted join rule (#12623) 2022-05-17 10:41:39 +00:00
notifier.py Add `StreamKeyType` class and replace string literals with constants (#12567) 2022-05-16 15:35:31 +00:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py SpamChecker metrics (#12513) 2022-05-13 12:17:38 +01:00
types.py Prevent expired events from being filtered out when retention is disabled (#12611) 2022-05-23 17:18:23 +00:00
visibility.py Prevent expired events from being filtered out when retention is disabled (#12611) 2022-05-23 17:18:23 +00:00