mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 11:53:23 +01:00
Store sessions by encodedNumber
Storing multiple sessions in a single indexeddb record is prone to clobbering data due to races between requests to update multiple device sessions for the same number, since you have to read the current state of the device->session map and update it. Splitting the records up makes it so that those updates can be made in parallel. Selecting all the sessions for a given number can still be done efficiently thanks to indexeddb range queries.
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
conversations.createIndex("group", "members", { unique: false, multiEntry: true });
|
||||
conversations.createIndex("type", "type", { unique: false });
|
||||
|
||||
var contacts = transaction.db.createObjectStore('contacts');
|
||||
var sessions = transaction.db.createObjectStore('sessions');
|
||||
var identityKeys = transaction.db.createObjectStore('identityKeys');
|
||||
|
||||
var preKeys = transaction.db.createObjectStore("preKeys");
|
||||
var signedPreKeys = transaction.db.createObjectStore("signedPreKeys");
|
||||
|
||||
Reference in New Issue
Block a user