Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make prev_state field optional #4837

Merged
merged 3 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4837.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where synapse expected an un-specced `prev_state` field on state events.
1 change: 0 additions & 1 deletion synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def __init__(self, event_dict, signatures={}, unsigned={},
origin = _event_dict_property("origin")
origin_server_ts = _event_dict_property("origin_server_ts")
prev_events = _event_dict_property("prev_events")
prev_state = _event_dict_property("prev_state")
redacts = _event_dict_property("redacts")
room_id = _event_dict_property("room_id")
sender = _event_dict_property("sender")
Expand Down
15 changes: 0 additions & 15 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1407,21 +1407,6 @@ def _update_metadata_tables_txn(self, txn, events_and_contexts,
values=state_values,
)

self._simple_insert_many_txn(
txn,
table="event_edges",
values=[
{
"event_id": event.event_id,
"prev_event_id": prev_id,
"room_id": event.room_id,
"is_state": True,
}
for event, _ in state_events_and_contexts
for prev_id, _ in event.prev_state
],
)

# Prefill the event cache
self._add_to_cache(txn, events_and_contexts)

Expand Down