Skip to content

Indicate which property has changed to onChanged event listeners

The SDK provides filters.onChanged and subscriptions.onChanged to react to filter/subscription changes. The extension cannot determine which property has changed though, which means that the same code is running for any change.

That's not a problem (yet) for filters, since it only has the "enabled" property, which means that the event only fires when the "enabled" property changes. However, it can lead to code being run unnecessarily when listening to subscription changes.

We're already encountering this problem when listening to subscription changes for updating the extension's uninstall URL. This only needs to happen when a subscription gets either added, disabled, enabled or removed. With the current behavior of subscription.onChanged, it's also happening whenever any other property of the subscription changes (e.g. "downloading", "lastDownload", "softExpiration", "title", "version").