mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-06 10:07:58 -05:00
Merge pull request #228 from matrix-org/erikj/_get_state_for_groups
Ensure we never return a None event from _get_state_for_groups
This commit is contained in:
commit
e624cdec64
@ -398,6 +398,7 @@ class StateStore(SQLBaseStore):
|
|||||||
# for them again.
|
# for them again.
|
||||||
state_dict = {key: None for key in types}
|
state_dict = {key: None for key in types}
|
||||||
state_dict.update(results[group])
|
state_dict.update(results[group])
|
||||||
|
results[group] = state_dict
|
||||||
else:
|
else:
|
||||||
state_dict = results[group]
|
state_dict = results[group]
|
||||||
|
|
||||||
@ -412,9 +413,11 @@ class StateStore(SQLBaseStore):
|
|||||||
full=(types is None),
|
full=(types is None),
|
||||||
)
|
)
|
||||||
|
|
||||||
# We replace here to remove all the entries with None values.
|
# Remove all the entries with None values. The None values were just
|
||||||
|
# used for bookkeeping in the cache.
|
||||||
|
for group, state_dict in results.items():
|
||||||
results[group] = {
|
results[group] = {
|
||||||
key: value for key, value in state_dict.items() if value
|
key: event for key, event in state_dict.items() if event
|
||||||
}
|
}
|
||||||
|
|
||||||
defer.returnValue(results)
|
defer.returnValue(results)
|
||||||
|
Loading…
Reference in New Issue
Block a user