Clear session store when re-registering
When we re-register, our deviceId might change, which makes our sessions are no longer valid since the recipient will see us as a new device. Fixes #388
This commit is contained in:
parent
a52d35bb1b
commit
80d32103d1
4 changed files with 50 additions and 26 deletions
|
@ -114,6 +114,17 @@ describe("AxolotlStore", function() {
|
|||
});
|
||||
}).then(done,done);
|
||||
});
|
||||
it ('clears the session store', function(done) {
|
||||
var testRecord = "an opaque string";
|
||||
store.putSession(identifier + '.1', testRecord).then(function() {
|
||||
return store.clearSessionStore().then(function() {
|
||||
return store.getSession(identifier + '.1').then(function(record) {
|
||||
assert.isUndefined(record);
|
||||
});
|
||||
});
|
||||
}).then(done,done);
|
||||
|
||||
});
|
||||
it('returns deviceIds for a number', function(done) {
|
||||
var testRecord = "an opaque string";
|
||||
var devices = [1, 2, 3].map(function(deviceId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue