summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/Connection.js
authorClipperz <info@clipperz.com>2013-01-08 15:17:30 (UTC)
committer Clipperz <info@clipperz.com>2013-01-08 15:17:30 (UTC)
commit267603e3aa3cf0029411e67ae14018b52344c296 (patch) (side-by-side diff)
tree055e8f8d8543ed6bfa342dbf4641fea308c2ec5a /frontend/beta/js/Clipperz/PM/Connection.js
parentb6a11a37ec3271bd44fc23b9da00c5b052b0d8b9 (diff)
downloadclipperz-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.js9
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
@@ -296,11 +296,15 @@ deferredResult.addErrback(MochiKit.Base.bind(function(res) {MochiKit.Logging.log
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);
@@ -577,5 +581,6 @@ Clipperz.PM.Connection.SRP['1.1'].prototype = MochiKit.Base.update(new Clipperz.
});
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")
};