diff --git a/anki/sync.py b/anki/sync.py index 8abe25914..4bc60e768 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -206,6 +206,12 @@ class SyncTools(object): self.rebuildPriorities(cardIds) # rebuild due counts self.deck.rebuildCounts(full=False) + assert self.missingFacts() == 0 + + def missingFacts(self): + return self.deck.s.scalar( + "select count() from cards where factId "+ + "not in (select id from facts)"); def rebuildPriorities(self, cardIds, suspend=[]): self.deck.updateAllPriorities(partial=True, dirty=False)