Skip to content

Commit

Permalink
fixIntegrity Refactor / Instrument+continue if field count fix fails
Browse files Browse the repository at this point in the history
* 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
david-allison authored and mikehardy committed Mar 26, 2020
1 parent 99f03b4 commit f8123f1
Show file tree
Hide file tree
Showing 3 changed files with 373 additions and 179 deletions.
Loading

0 comments on commit f8123f1

Please sign in to comment.