Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Bug 714657 - Persist earliest next sync in Android Account data rather t... #207

Merged
merged 4 commits into from Jun 11, 2012

Conversation

ncalexan
Copy link
Contributor

@ncalexan ncalexan commented Jun 4, 2012

...han "sync.prefs.global" Shared Preferences.

Long term sync.prefs.globals should go away, and certainly next sync
is Account specific, so this seemed the right thing to do. I made
next sync an Account datum because we want to access it without
invoking the full Account Manager callback needed to retrieve encoded
username and server URL.

@ghost ghost assigned liuche Jun 4, 2012
@rnewman
Copy link
Contributor

rnewman commented Jun 4, 2012

Not quite true.

Account should hold attributes that are specific to the account: the sync key, the server.

Prefs holds attributes that are specific to some (account, fennec, …) tuple. This is one such thing.

Consider if the same Android account is syncing with Nightly and Beta. By storing the next sync timestamp in the account, you're ensuring that only one of them will get to sync.

In general we should be using prefs for anything that's not "pretty much immutable".

@ncalexan
Copy link
Contributor Author

ncalexan commented Jun 6, 2012

I'm not sure I agree with you re: what should be stored in Account and what should not, but I really don't have full picture re: multiple Fennecs, multiple profiles, etc so I won't move on that now.

I've rewritten this to correctly wipe the user prefs (there were encoding bugs) and to wipe the global prefs too (since we only support one account right now, we can always wipe the global prefs on new account creation). Device tests are good for me.

I would like to verify this doesn't break migrating settings during profile migration (cluster URL and sync ID), and I am confident it won't, but my Fennec is borked so it will have to wait.

@@ -176,22 +176,61 @@ public static long decimalSecondsToMilliseconds(Integer decimal) {
return (long)(decimal * 1000);
}

public static byte[] sha1(String utf8)
protected static byte[] sha1(String utf8)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're touching this, can we make utf8 final?

@liuche
Copy link
Contributor

liuche commented Jun 11, 2012

Sorry this took a while, this looks fine for band-aiding using global prefs. r+ from me.

Is there a bug for making prefs to support multiple firefox instances?

@rnewman
Copy link
Contributor

rnewman commented Jun 11, 2012

Please correct the title of this pull req.

@rnewman
Copy link
Contributor

rnewman commented Jun 11, 2012

Chenxia: Bug 761682 covers reorganizing prefs.

@ncalexan ncalexan merged commit fd40d64 into develop Jun 11, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants