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) (unidiff) | |
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 | |||
@@ -295,13 +295,17 @@ deferredResult.addErrback(MochiKit.Base.bind(function(res) {MochiKit.Logging.log | |||
295 | //MochiKit.Logging.logDebug("--- Connection.loginDone - someParameters: " + Clipperz.Base.serializeJSON(someParameters)); | 295 | //MochiKit.Logging.logDebug("--- Connection.loginDone - someParameters: " + Clipperz.Base.serializeJSON(someParameters)); |
296 | this.setConnectionId(someParameters['connectionId']); | 296 | this.setConnectionId(someParameters['connectionId']); |
297 | this.user().setLoginInfo(someParameters['loginInfo']); | 297 | this.user().setLoginInfo(someParameters['loginInfo']); |
298 | this.user().setShouldDownloadOfflineCopy(someParameters['offlineCopyNeeded']); | 298 | this.user().setShouldDownloadOfflineCopy(someParameters['offlineCopyNeeded']); |
299 | this.user().setLock(someParameters['lock']); | 299 | |
300 | if ((isReconnecting == true) && (this.user().lock() != someParameters['lock'])) { | ||
301 | throw Clipperz.PM.Connection.exception.StaleData; | ||
302 | } | ||
300 | 303 | ||
301 | if (this.oneTimePassword() != null) { | 304 | if (this.oneTimePassword() != null) { |
302 | result.addCallback(MochiKit.Base.method(this.user().oneTimePasswordManager(), 'archiveOneTimePassword', this.oneTimePassword())); | 305 | result.addCallback(MochiKit.Base.method(this.user().oneTimePasswordManager(), 'archiveOneTimePassword', this.oneTimePassword())); |
303 | } | 306 | } |
307 | |||
304 | result.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'connection_loggedIn'); | 308 | result.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'connection_loggedIn'); |
305 | result.addCallback(MochiKit.Async.succeed, someParameters); | 309 | result.addCallback(MochiKit.Async.succeed, someParameters); |
306 | 310 | ||
307 | result.callback(); | 311 | result.callback(); |
@@ -576,6 +580,7 @@ Clipperz.PM.Connection.SRP['1.1'].prototype = MochiKit.Base.update(new Clipperz. | |||
576 | 580 | ||
577 | }); | 581 | }); |
578 | 582 | ||
579 | Clipperz.PM.Connection.exception = { | 583 | Clipperz.PM.Connection.exception = { |
580 | WrongChecksum: new MochiKit.Base.NamedError("Clipperz.ByteArray.exception.InvalidValue") | 584 | WrongChecksum: new MochiKit.Base.NamedError("Clipperz.ByteArray.exception.InvalidValue"), |
585 | StaleData: new MochiKit.Base.NamedError("Stale data") | ||
581 | }; | 586 | }; |