Catch and handle errors if getOptionsFull fails #930
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #723
I think this issue is due to calling
triggerDatabaseUpdated
without an await before_addDictionarySettings
causing a race condition. But due to the nature of this bug there's no way to be 100% sure.Simply awaiting
triggerDatabaseUpdated
doesn't work due to it callingensureDictionarySettings
conflicting with_addDictionarySettings
and creating duplicate dict settings. (ensureDictionarySettings
makes sure all dicts have settings entries and adds one if it is lacking._addDictionarySettings
adds a setting regardless of whether one exists already.)Running
triggerDatabaseUpdated
after_addDictionarySettings
appears to work perfectly fine.I've also allowed
getOptionsFull
to retry up to 10 times if it fails, catching any errors so the dict import process is not interrupted.At a minimum these fixes will make it so firefox users don't have to worry about the dict import process randomly breaking when importing multiple dicts and requiring manually restarting the import. But hopefully this will entirely eliminate settings related errors for firefox imports.