Don't allow duplicate custom filters
Background / User story
This is a follow up to #407 (closed) that reveals some of the conceptual issues with custom filters.
FilterStorage.addFilter()
, when called with just a filter text, will look up the filter in existing SpecialSubscription
and if found will do nothing and return the subscription.
However FilterStorage.addFiltersWithMetadata()
will create a new subscription regardless, and return it.
Digging on how the SDK do things and the assumption, as well as what's the initial goal, it sounds that we should add the constrain that we cannot add a custom filter that already exists.
What to change
Development:
- Change
FilterStorage.addFiltersWithMetadata()
to detect duplicates - Make an API to return errors properly and make sure that
FilterStorage.addFilter()
returns an error if the filter already exists. - Ensure other parts of the API are consistent with this.
Documentation:**
- Update the documentation and release notes to match this.
Hints for testing
TBD