This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Remove backwards compat hack from EventContext
serialzation code #15777
Copy link
Copy link
Closed
Labels
O-UncommonMost users are unlikely to come across this or unexpected workflowMost users are unlikely to come across this or unexpected workflowS-TolerableMinor significance, cosmetic issues, low or no impact to users.Minor significance, cosmetic issues, low or no impact to users.T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Z-Future-MaintenanceThings that can't yet be done, but will need cleaning up in a couple of months/releasesThings that can't yet be done, but will need cleaning up in a couple of months/releases
Milestone
Description
#15233 changed the format of EventContext
and as such required two small hacks to make the serialization backwards compatible:
synapse/synapse/events/snapshot.py
Lines 206 to 212 in 553f2f5
# workaround for backwards/forwards compatibility: if the input doesn't have a value | |
# for "state_group_deltas" just assign an empty dict | |
state_group_deltas = input.get("state_group_deltas", None) | |
if state_group_deltas: | |
state_group_deltas = _decode_state_group_delta(state_group_deltas) | |
else: | |
state_group_deltas = {} |
synapse/synapse/events/snapshot.py
Lines 189 to 191 in 553f2f5
# add dummy delta_ids and prev_group for backwards compatibility | |
"delta_ids": None, | |
"prev_group": None, |
We should remove these after a few (let's say 4?) releases. The second one (lines 189-191) can just be removed, and the first one just requires a change:
state_group_deltas = _decode_state_group_delta(input["state_group_deltas"])
and the removal of the if
statement.
Metadata
Metadata
Assignees
Labels
O-UncommonMost users are unlikely to come across this or unexpected workflowMost users are unlikely to come across this or unexpected workflowS-TolerableMinor significance, cosmetic issues, low or no impact to users.Minor significance, cosmetic issues, low or no impact to users.T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Z-Future-MaintenanceThings that can't yet be done, but will need cleaning up in a couple of months/releasesThings that can't yet be done, but will need cleaning up in a couple of months/releases