Add version field to SessionRecord

The session state format changed. Make a note of it.
This commit is contained in:
lilia 2016-09-19 17:58:17 -07:00
parent ddba403ef5
commit 7b21a4bed4
2 changed files with 8 additions and 2 deletions

View File

@ -35515,6 +35515,7 @@ Internal.ChainType = {
Internal.SessionRecord = function() {
'use strict';
var ARCHIVED_STATES_MAX_LENGTH = 40;
var SESSION_RECORD_VERSION = 'v1';
var StaticByteBufferProto = new dcodeIO.ByteBuffer().__proto__;
var StaticArrayBufferProto = new ArrayBuffer().__proto__;
@ -35556,6 +35557,7 @@ Internal.SessionRecord = function() {
var SessionRecord = function() {
this._sessions = {};
this.version = SESSION_RECORD_VERSION;
};
SessionRecord.deserialize = function(serialized) {
@ -35571,7 +35573,8 @@ Internal.SessionRecord = function() {
SessionRecord.prototype = {
serialize: function() {
return jsonThing({
sessions : this._sessions
sessions : this._sessions,
version : this.version
});
},
haveOpenSession: function() {

View File

@ -16,6 +16,7 @@ Internal.ChainType = {
Internal.SessionRecord = function() {
'use strict';
var ARCHIVED_STATES_MAX_LENGTH = 40;
var SESSION_RECORD_VERSION = 'v1';
var StaticByteBufferProto = new dcodeIO.ByteBuffer().__proto__;
var StaticArrayBufferProto = new ArrayBuffer().__proto__;
@ -57,6 +58,7 @@ Internal.SessionRecord = function() {
var SessionRecord = function() {
this._sessions = {};
this.version = SESSION_RECORD_VERSION;
};
SessionRecord.deserialize = function(serialized) {
@ -72,7 +74,8 @@ Internal.SessionRecord = function() {
SessionRecord.prototype = {
serialize: function() {
return jsonThing({
sessions : this._sessions
sessions : this._sessions,
version : this.version
});
},
haveOpenSession: function() {