mirror of
https://github.com/element-hq/synapse
synced 2024-09-07 11:40:05 +00:00
Fix lazy loaded sync with rejected state events
In particular, we assume that the name and canonical alias events in the state have not been rejected. In practice this may not be the case (though we should probably think about fixing that) so lets ensure that we gracefully handle that case, rather than 404'ing the sync request like we do now.
This commit is contained in:
parent
8f5c23d0cd
commit
82f922b4af
1 changed files with 2 additions and 2 deletions
|
@ -567,13 +567,13 @@ class SyncHandler(object):
|
||||||
# be a valid name or canonical_alias - i.e. we're checking that they
|
# be a valid name or canonical_alias - i.e. we're checking that they
|
||||||
# haven't been "deleted" by blatting {} over the top.
|
# haven't been "deleted" by blatting {} over the top.
|
||||||
if name_id:
|
if name_id:
|
||||||
name = yield self.store.get_event(name_id, allow_none=False)
|
name = yield self.store.get_event(name_id, allow_none=True)
|
||||||
if name and name.content:
|
if name and name.content:
|
||||||
defer.returnValue(summary)
|
defer.returnValue(summary)
|
||||||
|
|
||||||
if canonical_alias_id:
|
if canonical_alias_id:
|
||||||
canonical_alias = yield self.store.get_event(
|
canonical_alias = yield self.store.get_event(
|
||||||
canonical_alias_id, allow_none=False,
|
canonical_alias_id, allow_none=True,
|
||||||
)
|
)
|
||||||
if canonical_alias and canonical_alias.content:
|
if canonical_alias and canonical_alias.content:
|
||||||
defer.returnValue(summary)
|
defer.returnValue(summary)
|
||||||
|
|
Loading…
Reference in a new issue