Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29339666: Issue 3915 - Dispatch filters.added consistently (Closed)

Created:
April 13, 2016, 7:44 a.m. by kzar
Modified:
April 14, 2016, 9:50 a.m.
Visibility:
Public.

Description

Issue 3915 - Dispatch filters.added consistently

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -7 lines) Patch
M lib/filterStorage.js View 1 chunk +9 lines, -7 lines 0 comments Download

Messages

Total messages: 3
kzar
Patch Set 1
April 13, 2016, 7:45 a.m. (2016-04-13 07:45:32 UTC) #1
Wladimir Palant
NOT LGTM With this approach there will be two notifications sent out for this filter, ...
April 14, 2016, 9:20 a.m. (2016-04-14 09:20:55 UTC) #2
Sebastian Noack
April 14, 2016, 9:50 a.m. (2016-04-14 09:50:41 UTC) #3
Message was sent while issue was closed.
On 2016/04/14 09:20:55, Wladimir Palant wrote:
> NOT LGTM
> 
> With this approach there will be two notifications sent out for this filter,
> first subscription.added and then filter.added. Note that the former already
> implies filter.added because the filter is listed in the subscription. This
will
> very likely cause issues with the Filter Preferences in Firefox because
filters
> aren't treated as a plain list there.
> 
> Proper solution would be handling subscription.added correctly in Chrome - for
> SpecialSubscription instances all filters on the subscription should be added.

Yes, alternatively we could handle the filters that are already in the
subscription when a special subscription is added. However, this makes the logic
more complicated, as everywhere where you have to respond to new custom filters
you'd have to handle subscription.added and filter.added. In particular where we
have to rely on asynchronous messaging this requires quite some addional logic.

I'm not exactly sure about the implications for Filter Preferences on Firefox,
but IMO the code should handle filter.added anyway, so it shouldn't make any
difference whether we first create an empty subscription and then add filter(s)
to it, or whether we create the subscription with the first filter already in
there.

Powered by Google App Engine
This is Rietveld