Bug 504346 - Set the storage version with storage version instead of weave version

Rename MIN_SERVER_STORAGE_VERSION -> STORAGE_VERSION and use it when setting meta/global's storageVersion.
This commit is contained in:
Edward Lee 2009-07-15 10:31:35 -07:00
parent 5d5107e98e
commit af402ab06f
2 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['WEAVE_VERSION', 'MIN_SERVER_STORAGE_VERSION',
const EXPORTED_SYMBOLS = ["WEAVE_VERSION", "STORAGE_VERSION",
'PREFS_BRANCH',
'MODE_RDONLY', 'MODE_WRONLY',
'MODE_CREATE', 'MODE_APPEND', 'MODE_TRUNCATE',
@ -59,7 +59,7 @@ const WEAVE_VERSION = "@weave_version@";
// last client version's server storage this version supports
// e.g. if set to the current version, this client will wipe the server
// data stored by any older client
const MIN_SERVER_STORAGE_VERSION = "@storage_version@";
const STORAGE_VERSION = "@storage_version@";
const PREFS_BRANCH = "extensions.weave.";

View File

@ -609,11 +609,11 @@ WeaveSvc.prototype = {
let remoteVersion = (meta && meta.payload.storageVersion)?
meta.payload.storageVersion : "";
this._log.debug("Min supported storage version is " + MIN_SERVER_STORAGE_VERSION);
this._log.debug("Local storage version is " + STORAGE_VERSION);
this._log.debug("Remote storage version is " + remoteVersion);
if (!meta || !meta.payload.storageVersion || !meta.payload.syncID ||
Svc.Version.compare(MIN_SERVER_STORAGE_VERSION, remoteVersion) > 0) {
Svc.Version.compare(STORAGE_VERSION, remoteVersion) > 0) {
// abort the server wipe if the GET status was anything other than 404 or 200
let status = Records.lastResource.lastChannel.responseStatus;
@ -628,7 +628,7 @@ WeaveSvc.prototype = {
this._log.info("No metadata record, server wipe needed");
if (meta && !meta.payload.syncID)
this._log.warn("No sync id, server wipe needed");
if (Svc.Version.compare(MIN_SERVER_STORAGE_VERSION, remoteVersion) > 0)
if (Svc.Version.compare(STORAGE_VERSION, remoteVersion) > 0)
this._log.info("Server storage version no longer supported, server wipe needed");
if (!this._keyGenEnabled) {
@ -915,8 +915,8 @@ WeaveSvc.prototype = {
this._log.debug("Uploading new metadata record");
meta = new WBORecord(this.clusterURL + this.username + "/meta/global");
this._log.debug("Setting meta payload storage version to " + WEAVE_VERSION);
meta.payload.storageVersion = WEAVE_VERSION;
this._log.debug("Setting meta payload storage version to " + STORAGE_VERSION);
meta.payload.storageVersion = STORAGE_VERSION;
meta.payload.syncID = Clients.syncID;
let res = new Resource(meta.uri);
res.put(meta.serialize());