Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5052 closed change (fixed)

Allow importing and exporting filterStorage data without file access

Reported by: trev Assignee: trev
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: #5051, #5059 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29398705/

Description

Background

In #5051 we will move file access for custom backups outside filterStorage.js. The public API needs to be adjusted in order to support this.

What to change

  • Rename FilterStorage._generateFilterData method into FilterStorage.exportData.
  • Add FilterStorage.importData method returning a function to be called for each line and then with null to finalize import (import can be aborted by "forgetting" this function before the final call).
  • Remove parameters of FilterStorage.loadFromDisk and FilterStorage.saveToDisk methods, these are always dealing with the default file now.
  • Make FilterStorage.loadFromDisk call FilterStorage.importData for most of its work.

Change History (10)

comment:1 Changed 3 years ago by trev

  • Blocking 5059 added

comment:2 Changed 3 years ago by trev

  • Owner set to trev

comment:3 Changed 3 years ago by trev

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

comment:5 Changed 3 years ago by trev

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

comment:6 Changed 3 years ago by trev

  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's reopen this - unit tests are broken, these need to be updated.

comment:7 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 5052 - Adjust filter storage unit tests for API changes

comment:8 Changed 3 years ago by trev

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

comment:9 Changed 3 years ago by kzar

I think these changes have now caused an ESLint error, getting a no-unused-vars error for test/filterStorage_readWrite.js now.

comment:10 Changed 3 years ago by trev

Indeed, Subscription class is no longer used.

Note: See TracTickets for help on using tickets.