Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixIntegrity Refactor / Instrument+continue if field count fix fails
* Refactor: notifyProgress * Extract: deleteNotesWithMissingModel * Extract: deleteCardsWithInvalidModelOrdinals * Extract: deleteNotesWithWrongFieldCounts * Extract: deleteNotesWithMissingCards * Extract: deleteCardsWithMissingNotes * Extract: removeOriginalDuePropertyWhereInvalid * Extract: removeDynamicPropertyFromNonDynamicDecks * Extract: removeDeckOptionsFromDynamicDecks * Extract: rebuildTags * Extract: updateFieldCache * Extract: fixNewCardDuePositionOverflow * Extract: fixNewCardDuePositionOverflow * Extract: fixExcessiveReviewDueDates * Extract: fixDecimalIntervals * Extract: restoreMissingDatabaseIndices * Extract: ensureModelsAreNotEmpty * Refactor: Remove unused variable * Refactor: return integrity `problems` from checks * Refactor: abstract to executeIntegrityTask * Refactor: abstract additional integrity methods * Refactor: abstract integrity methods which throw * deleteNotesWithWrongFieldCounts: Handle exception We discuss a badly understood exception in #5852. For now, we can catch the specific exception and attempt to understand it better without crashing or stopping the check. * deleteNotesWithWrongFieldCounts: Add Logging * NF: convert `optimize` to IntegrityTask * Refactor: Split fixDecimalIntervals * deleteNotesWithWrongFieldCount: Debugging Added additional exception details * fixIntegrity: report any exceptions * ensureModelsAreNotEmpty: add recovery * fixIntegrity: removed main transaction * fixIntegrity: removed early return * fix call to optimize Can't be called inside a transaction * fixIntegrity: Run each check in transaction This fixes #5852 - Previously a crash in fixIntegrity would crash, or or stop the process. Now, we perform as many idempotent tasks as we can. * deleteNotesWithWrongFieldCounts improve logging * fixIntegrity: debug logging * NF: Convert to isDatabaseIntegrityOk * fixIntegrity: marked notifyProgress defect * fixIntegrity: notified more progress steps
- Loading branch information