Closed Bug 1081590 Opened 5 years ago Closed 5 years ago

ConfigurationMigrator downgrading does not work

Categories

(Firefox for Android :: Android Sync, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 36

People

(Reporter: ckitching, Assigned: ckitching)

Details

Attachments

(1 file)

While trawling the results of IDEA's inspection suite, I came across this little gem:

At: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/sync/config/ConfigurationMigrator.java#369

if (currentVersion == 0 && desiredVersion == 1) {
      Logger.info(LOG_TAG, "Upgrading from version 0 to version 1.");
      upgrade0to1(context, accountManager, account, product, username, serverURL, profile);
    } else if (currentVersion == 1 && desiredVersion == 0) {
      Logger.info(LOG_TAG, "Upgrading from version 0 to version 1.");
      upgrade0to1(context, accountManager, account, product, username, serverURL, profile);
    } 


The if branches are identical (which is what the tool picked up on).
Whoops!

We further see that the suspiciously-useful-looking downgrade1to0 is never called.
Comment on attachment 8503699 [details] [diff] [review]
Actually call the downgrade function in ConfigurationMigrator

Review of attachment 8503699 [details] [diff] [review]:
-----------------------------------------------------------------

Upstream needed!

::: mobile/android/base/sync/config/ConfigurationMigrator.java
@@ +369,5 @@
>      if (currentVersion == 0 && desiredVersion == 1) {
>        Logger.info(LOG_TAG, "Upgrading from version 0 to version 1.");
>        upgrade0to1(context, accountManager, account, product, username, serverURL, profile);
>      } else if (currentVersion == 1 && desiredVersion == 0) {
>        Logger.info(LOG_TAG, "Upgrading from version 0 to version 1.");

Fix the comment, too.
Attachment #8503699 - Flags: review?(rnewman) → review+
Status: NEW → ASSIGNED
OS: Linux → Android
Hardware: x86_64 → All
Summary: ConfigurationMigrator downgrading does not work. → ConfigurationMigrator downgrading does not work
https://hg.mozilla.org/mozilla-central/rev/a615a67cce1e
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
Product: Android Background Services → Firefox for Android
You need to log in before you can comment on or make changes to this bug.