1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-14 17:29:23 +03:00
Commit Graph

242 Commits

Author SHA1 Message Date
J. Ryan Stinnett
eadec35093 Add an IndexedDB existence check to the main store
This will be useful for future storage diagnostics as part of
https://github.com/vector-im/riot-web/issues/9271.
2019-03-25 16:11:51 +00:00
J. Ryan Stinnett
48f290196c Rename MatrixInMemoryStore to MemoryStore
None of the other store classes use the `Matrix` prefix, and I find the mismatch
confusing (it leads me to think it might have a different purpose than the
others).

This change removes the prefix from the store for consistency. The old name is
left as an export for existing SDK consumers.
2019-03-19 14:24:47 +00:00
David Baker
9bafed2c26 OK fine, we'll use the session store 2019-02-07 15:33:49 +00:00
Bruno Windels
caba350b33 throw error with same name and message over idb worker boundary
instead of string currently thrown. This allows handling error
from the main thread.
2018-10-05 12:48:12 +02:00
David Baker
bd2da08c4e Reject with the actual error on indexeddb error
Rather than the event
2018-10-02 16:48:27 +01:00
Bruno Windels
6dd5c6c317 fix existing missing this 2018-09-26 11:33:19 +01:00
Bruno Windels
4e0af3eafe don't return the IDBEvent from storeClientOptions
as it's not needed and not cloneable
2018-09-26 11:32:43 +01:00
Bruno Windels
1d0791142c all store methods should return a promise 2018-09-26 11:32:11 +01:00
Bruno Windels
2560ba2980 dont clear the store if its a brand new one 2018-09-26 10:37:52 +01:00
Bruno Windels
19be3dd852 fix lint 2018-09-26 10:13:40 +01:00
Bruno Windels
b0dbb20e22 fixup of in memory stores 2018-09-25 15:53:40 +01:00
Bruno Windels
76175abea2 allow storing client options in indexeddb
so we can tell what options the sync data was created with
2018-09-25 15:30:35 +01:00
Bruno Windels
1511a27f4c update/remove comments 2018-09-06 18:09:46 +02:00
Bruno Windels
7ae6c147fa lint doesnt like async 2018-09-06 18:02:19 +02:00
Bruno Windels
f51630eb07 dont create a promise for every inserted member but await the transaction instead 2018-09-06 18:01:20 +02:00
Bruno Windels
3bed5969bf remove count logging, approach confirmed to work and be according to idb spec 2018-09-03 10:27:00 +02:00
Bruno Windels
7258fe4e5c clear out of band members in store when leaving room 2018-08-31 14:42:15 +02:00
Bruno Windels
f8ea1702f8 store support for removing out of band members for a room 2018-08-31 14:42:15 +02:00
Bruno Windels
8c01ed1469 add comments explaining why we ignore the put promise result 2018-08-15 12:01:26 +02:00
Bruno Windels
0fa49bc2cd PR feedback 2018-08-15 12:00:38 +02:00
Bruno Windels
b034f67a0f add oob member methods to stub store 2018-08-15 12:00:38 +02:00
Bruno Windels
977b9eb686 implement memory store methods 2018-08-15 12:00:38 +02:00
Bruno Windels
5e11bf735e store OOB status along with members, to avoid unneccesary fetching
for some small rooms, it is possible that calling /members would not
yield any previously unknown members, as they were all recently active.
This would be the case for most DMs.

For these rooms, we'd end up with 0 OOB members after lazy loading them,
so when getting them out of storage we need a way to distuinguist this case
from never having lazy loaded the members of the room at all.

We store a marker object in the same store and return [] or null accordingly.
This way the /members don't get fetched a second time.
2018-08-15 12:00:38 +02:00
Bruno Windels
a8c73f7a4d add logging, should be useful as long as not merged into develop 2018-08-15 12:00:38 +02:00
Bruno Windels
0364af7337 update indexeddb store to store member events, not profile information 2018-08-15 12:00:38 +02:00
Bruno Windels
d366ec9c48 prototype how we could store ll members 2018-08-15 12:00:38 +02:00
David Baker
16c062c069 Start first incremental sync request early (#629)
* Start first incremental sync request early

So it can run while we process our sync data.
2018-03-16 15:22:06 +00:00
David Baker
dc3ffb3b30 Fix jsdoc 2018-03-09 17:39:02 +00:00
David Baker
5c2dfb138a Hopefully clarify _startPromise 2018-03-09 17:35:03 +00:00
David Baker
0be679de42 Make local variable look less like a global 2018-03-09 17:31:08 +00:00
David Baker
8bd68e0f10 Create indexeddb worker when starting the store
Rather than when creating it, otherwise we could potentially end
up starting workers unnecessarily.
2018-03-09 16:53:27 +00:00
David Baker
b246545da5 Merge remote-tracking branch 'origin/develop' into dbkr/fix_indexeddb_logging 2018-03-09 10:21:00 +00:00
David Baker
3280cb648f Merge pull request #625 from matrix-org/dbkr/stop_spinner_of_doom
Don't do /keys/changes on incremental sync
2018-03-09 10:19:26 +00:00
David Baker
8798bf42e6 Fix indexeddb logging
1. Fix double 'loaded' on sync data logging
2. Move the 'loaded' message into the bit where the data has
   actually loaded rather than the promise try block.
3. Add '...' to the 'loading' messages so they're easier to tell
   apart from the 'loaded' messages.
2018-03-09 10:16:32 +00:00
Matthew Hodgson
beafd597dd ensure indexeddb workers are never double-connected 2018-03-09 02:18:19 +00:00
Matthew Hodgson
fbc43b0d58 stupid typo 2018-03-09 00:01:14 +00:00
David Baker
727ad5755e lint 2018-03-08 12:40:01 +00:00
David Baker
4f17352858 Don't do /keys/changes on incremental sync
Remove the call to /keys/changes when we do an incremental syn
where the old sync token doesn't match the one in the device list
store. To allow us to do this, always save the device list store
before saving the sync data, so we can safely assume the device
list store is at least as fresh as the sync token in the sync store.

Thread save functions through to allow this, add a delay parameter
so the sync can save the device list immediately and skip the wait,
and add a wantsSave() method so the sync can skip saving the device
list if the sync store isn't going to save anyway.

Fixes https://github.com/vector-im/riot-web/issues/6068
2018-03-08 12:33:08 +00:00
Matthew Hodgson
ae14cf4740 typo 2018-02-20 12:38:12 +00:00
David Baker
e4ffc93463 Remove unused function 2018-01-22 18:34:34 +01:00
David Baker
e4de333d83 Use the right prefix function to remove prefix 2018-01-22 17:55:40 +01:00
David Baker
e72096328a Actually working migration 2018-01-22 17:46:13 +01:00
David Baker
88a082a533 Hopefully working migration 2018-01-22 17:34:09 +01:00
David Baker
8b649cec8d All the copyrights 2018-01-18 11:52:27 +00:00
David Baker
a94f3c720e Fix migration 2018-01-12 15:12:57 +00:00
David Baker
6c1087e429 Migrate from session store 2018-01-12 14:41:08 +00:00
David Baker
0748c864cd Migrate inbound sessions from session store 2017-12-07 14:57:18 +00:00
David Baker
fd083e1e66 doc 2017-12-05 10:04:06 +00:00
David Baker
5e4149ae76 Remove unused function 2017-12-04 18:14:56 +00:00
David Baker
6782d53e28 Remove prefix from sessions store keys 2017-12-04 17:36:33 +00:00