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

Unified Diff: adblockplus/issue-6108.patch

Issue 29626577: Issue 6108 - No filter list is selected after a migration failure (Closed)
Patch Set: Small adjustments Created Dec. 5, 2017, 3:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « adblockplus/build.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: adblockplus/issue-6108.patch
===================================================================
new file mode 100644
--- /dev/null
+++ b/adblockplus/issue-6108.patch
@@ -0,0 +1,42 @@
+Issue 6108 - No filter list is selected after a migration failure
+
+diff --git a/lib/filterStorage.js b/lib/filterStorage.js
+--- a/lib/filterStorage.js
++++ b/lib/filterStorage.js
+@@ -43,16 +43,18 @@ let formatVersion = 5;
+ let FilterStorage = exports.FilterStorage =
+ {
+ /**
+ * Will be set to true after the initial loadFromDisk() call completes.
+ * @type {boolean}
+ */
+ initialized: false,
+
++ loadFromDiskFailed: false,
++
+ /**
+ * Version number of the patterns.ini format used.
+ * @type {number}
+ */
+ get formatVersion()
+ {
+ return formatVersion;
+ },
+@@ -398,16 +400,17 @@ let FilterStorage = exports.FilterStorag
+ {
+ return this.restoreBackup(backupIndex, true).then(() =>
+ {
+ if (this.subscriptions.length == 0)
+ return tryBackup(backupIndex + 1);
+ }).catch(error =>
+ {
+ // Give up
++ this.loadFromDiskFailed = true;
+ });
+ };
+
+ return IO.statFile(this.sourceFile).then(statData =>
+ {
+ if (!statData.exists)
+ {
+ this.firstRun = true;
« no previous file with comments | « adblockplus/build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld