Assert getting_diff_for is not filled when not possible in get_difference

This commit is contained in:
Lonami Exo 2022-05-30 13:29:58 +02:00
parent a38170d26a
commit 898e279218

View File

@ -520,16 +520,15 @@ class MessageBox:
def get_difference(self): def get_difference(self):
for entry in (ENTRY_ACCOUNT, ENTRY_SECRET): for entry in (ENTRY_ACCOUNT, ENTRY_SECRET):
if entry in self.getting_diff_for: if entry in self.getting_diff_for:
if entry in self.map: if entry not in self.map:
return fn.updates.GetDifferenceRequest( raise RuntimeError('Should not try to get difference for an entry without known state')
pts=self.map[ENTRY_ACCOUNT].pts,
pts_total_limit=None, return fn.updates.GetDifferenceRequest(
date=self.date, pts=self.map[ENTRY_ACCOUNT].pts,
qts=self.map[ENTRY_SECRET].pts if ENTRY_SECRET in self.map else NO_SEQ, pts_total_limit=None,
) date=self.date,
else: qts=self.map[ENTRY_SECRET].pts if ENTRY_SECRET in self.map else NO_SEQ,
# TODO investigate when/why/if this can happen )
self.end_get_diff(entry)
return None return None