Opened on 08/30/2017 at 03:20:25 PM

Closed on 09/15/2017 at 12:33:56 PM

#5598 closed defect (fixed)

Newly added special subscriptions shown in list

Reported by: greiner Assignee: greiner
Priority: P1 Milestone:
Module: User-Interface Keywords:
Cc: saroyanm, wspee Blocked By:
Blocking: Platform: Firefox Mobile
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29533638/

Description (last modified by greiner)

Environment

Nexus One (emulator with API level 25)
Firefox Nightly 57.0a1
Adblock Plus 2.99.0.1826 (gecko-webext)

How to reproduce

  1. Install extension
  2. Open mobile options page
  3. Dispatch "showPageOptions" message in the context of the options page to show page-specific options
    ext.onMessage._dispatch({
      type: "app.respond",
      action: "showPageOptions",
      args: [{host: "foo.com", whitelisted: false}]
    })
    
  4. Click on enable toggle to whitelist the current domain

Observed behaviour

Special subscription (e.g. ~user~123456) shows up in subscriptions list

Expected behaviour

No special subscriptions shown in subscriptions list

Further information

No "filter.added" event is dispatched by FilterListener but instead "subscription.added". The options page doesn't expect to get any special subscriptions though which is why it displays it the same way as any downloadable subscription.

The same may is also true for "subscription.removed" in which case we're not receiving individual "filter.removed" events. Therefore a generic solution would be preferrable to avoid having to deal with all sorts of edge cases.

How to test using test environment

For the sake of testing all different variants I've used the following instructions using the local test environment.

Code to use

window.postMessage({
  type: "message",
  messageId: -1,
  payload: {
    type: "subscriptions.respond",
    action: "added",
    args: [
      {
        url: "~user~1234",
        filters: [{text: "@@||example.com^$document", disabled: true}]
      }
    ]
  }
}, "*");

Steps to reproduce

  1. Open mobile-options.html?showPageOptions=true
  2. Execute code with action=added and disabled=true
  3. Execute code with action=removed and disabled=true
  4. Execute code with action=added and disabled=false
  5. Execute code with action=removed and disabled=false

Observed behavior

  • Initial
    • Custom subscription is not shown
    • Whitelist toggle is true
  • After 2:
    • Custom subscription is shown
    • Whitelist toggle is true
  • After 3:
    • Custom subscription is not shown
    • Whitelist toggle is true
  • After 4:
    • Custom subscription is shown
    • Whitelist toggle is true
  • After 5:
    • Custom subscription does not exist
    • Whitelist toggle is true

Expected behavior

  • Initial
    • Custom subscription is not shown
    • Whitelist toggle is true
  • After 2:
    • Custom subscription is not shown
    • Whitelist toggle is true
  • After 3:
    • Custom subscription is not shown
    • Whitelist toggle is true
  • After 4:
    • Custom subscription is not shown
    • Whitelist toggle is false
  • After 5:
    • Custom subscription is not shown
    • Whitelist toggle is true

Attachments (0)

Change History (8)

comment:1 Changed on 08/30/2017 at 03:22:06 PM by greiner

  • Cc saroyanm added

@saroyanm FYI: This issue likely also affects the desktop version of the new options page.

comment:2 Changed on 08/31/2017 at 05:44:42 PM by greiner

  • Owner set to greiner

comment:3 Changed on 09/01/2017 at 11:56:12 AM by greiner

  • Description modified (diff)

comment:4 Changed on 09/01/2017 at 01:00:46 PM by greiner

  • Description modified (diff)

The toggle button not changing was due to the changes I had to make in adblockpluschrome to be able to test it. Therefore I removed this part from the ticket description since it does work as expected.

comment:5 Changed on 09/01/2017 at 01:25:43 PM by greiner

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:6 Changed on 09/06/2017 at 10:10:37 AM by greiner

  • Cc wspee added

comment:7 Changed on 09/15/2017 at 12:33:16 PM by abpbot

comment:8 Changed on 09/15/2017 at 12:33:56 PM by greiner

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from greiner.
 
Note: See TracTickets for help on using tickets.