Skip to content

Fixes #423 - Keep migration errors. Expand on what's returned.

Rowan Deysel requested to merge 423-keep-migration-errors into master

This MR introduces the following:

  • Fixes to actually set the Pref data instead of just keeping it in memory. These changes are directly as suggested in the issue (Thanks Thomas!)
  • The migration_errors array that we store in Prefs is no longer a single array containing both subscription and filter migration errors. Instead, we have two separate arrays,and two separate means of getting and clearing them. See filters.getMigrationErrors and subscriptions.getMigrationErrors. This feels better than introducing a type property and definitely feels better than mixing them up. It also feels intuitive as UI's using the SDK can then specifically get the subscriptions or filters that can't be migrated, easily.
  • The data stored in the errors now contain the full filter and subscription objects (previously it was just the text)
  • The tests had to be changed fairly dramatically to allow for this. In the migration based tests the order of execution is especially important.
  • Changes in how service workers are suspended. See runner.js. This is potentially controversial so let me know what you think!
  • The getMigrationErrors and clearMigrationErrors functions for both filters and subscriptions are now async functions. This is to allow for initializing the Prefs module before using it.

Integrator Notes

  • Migration errors are now persisted after reloading the extension.
  • EWE.subscriptions.getMigrationErrors() now returns only migration errors that relate to subscriptions. Use EWE.filters.getMigrationErrors() for the filter equivalent.
  • These functions are now asynchronous.
  • getMigrationErrors in the subscriptions and filters namespaces now contain the full subscription and filter objects respectively.
Edited by Rowan Deysel

Merge request reports

Loading