Opened 3 weeks ago

Closed 7 days ago

#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

Change History (8)

comment:1 Changed 3 weeks ago by greiner

  • Cc saroyanm added

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

comment:2 Changed 3 weeks ago by greiner

  • Owner set to greiner

comment:3 Changed 3 weeks ago by greiner

  • Description modified (diff)

comment:4 Changed 3 weeks ago 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 3 weeks ago by greiner

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

comment:6 Changed 2 weeks ago by greiner

  • Cc wspee added

comment:7 Changed 7 days ago by abpbot

comment:8 Changed 7 days ago by greiner

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.