Closed Bug 1081590 Opened 10 years ago Closed 10 years ago

ConfigurationMigrator downgrading does not work

Categories

(Firefox for Android Graveyard :: Android Sync, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

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: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.