author | Clipperz <info@clipperz.com> | 2013-01-08 15:17:30 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-08 15:17:30 (UTC) |
commit | 267603e3aa3cf0029411e67ae14018b52344c296 (patch) (side-by-side diff) | |
tree | 055e8f8d8543ed6bfa342dbf4641fea308c2ec5a /frontend/beta/js/Clipperz/PM/Connection.js | |
parent | b6a11a37ec3271bd44fc23b9da00c5b052b0d8b9 (diff) | |
download | clipperz-267603e3aa3cf0029411e67ae14018b52344c296.zip clipperz-267603e3aa3cf0029411e67ae14018b52344c296.tar.gz clipperz-267603e3aa3cf0029411e67ae14018b52344c296.tar.bz2 |
Fixed corrupted card problem
Changes that check for a weird condition that was causing cards to get corrupted.
A similar change has been applied also to /gamma (in a different commit, though)
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Connection.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Connection.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Connection.js b/frontend/beta/js/Clipperz/PM/Connection.js index 85aea21..e81c7a6 100644 --- a/frontend/beta/js/Clipperz/PM/Connection.js +++ b/frontend/beta/js/Clipperz/PM/Connection.js @@ -293,17 +293,21 @@ deferredResult.addErrback(MochiKit.Base.bind(function(res) {MochiKit.Logging.log result = new MochiKit.Async.Deferred(); //MochiKit.Logging.logDebug("--- Connection.loginDone - someParameters: " + Clipperz.Base.serializeJSON(someParameters)); this.setConnectionId(someParameters['connectionId']); this.user().setLoginInfo(someParameters['loginInfo']); this.user().setShouldDownloadOfflineCopy(someParameters['offlineCopyNeeded']); - this.user().setLock(someParameters['lock']); + + if ((isReconnecting == true) && (this.user().lock() != someParameters['lock'])) { + throw Clipperz.PM.Connection.exception.StaleData; + } if (this.oneTimePassword() != null) { result.addCallback(MochiKit.Base.method(this.user().oneTimePasswordManager(), 'archiveOneTimePassword', this.oneTimePassword())); } + result.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'connection_loggedIn'); result.addCallback(MochiKit.Async.succeed, someParameters); result.callback(); //MochiKit.Logging.logDebug("--- Connection.loginDone - 1 - result: "/* + Clipperz.Base.serializeJSON(result)*/); } else { @@ -574,8 +578,9 @@ Clipperz.PM.Connection.SRP['1.1'].prototype = MochiKit.Base.update(new Clipperz. //----------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); Clipperz.PM.Connection.exception = { - WrongChecksum: new MochiKit.Base.NamedError("Clipperz.ByteArray.exception.InvalidValue") + WrongChecksum: new MochiKit.Base.NamedError("Clipperz.ByteArray.exception.InvalidValue"), + StaleData: new MochiKit.Base.NamedError("Stale data") }; |