1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00
Commit Graph

128 Commits

Author SHA1 Message Date
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
86105611fc we dont need a separate index? 2018-08-15 12:00:38 +02:00
Bruno Windels
c618ce4625 store only out of band members 2018-08-15 12:00:38 +02:00
Bruno Windels
2b9c834476 add comment to clarify how we avoid race 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
Bruno Windels
097e7df7c9 fix lint 2018-08-15 11:59:40 +02:00
Bruno Windels
5fcf9481b3 fix room not having access to event mapper + tests 2018-08-15 11:59:39 +02:00
Bruno Windels
62333b3e2c Use /members api for lazy loading
This commit is a substantial change, as /members returns state events,
not profile information as /joined_members, and this allows to simplify
the implementation quite a bit. We can assume again all members have
a state event associated with it.

I also changed most of the naming of lazy loaded members to
out-of-band members to reflect that this is the relevant bit for most
of the code, that the members didn't come through /sync but through
another channel.

This commit also addresses the race condition between /(joined_)members
and /sync. /members returns the members at the point in the timeline
at a given event id. Members are loaded at the last event
in the live timeline, and all members that come in from sync
in the mean time are marked as superseding the out of band members,
so they won't be overwritten, even if the timeline is reset in the
mean time.

Members are also marked if they originate from an out-of-band channel
(/members) so they can be stored accordingly (future PR).

The loading status is kept in room state now, as this made resolving
the race condition easier. One consequence is that the status needs
to be shared across cloned instances of RoomState. When resetting
the timeline (and cloning the room state) while lazy loading is in
progress, one of the RoomStates could be left in progress indefinitely.
Though that is more for clarity than avoiding any actual bugs.
2018-08-15 11:59:39 +02:00
Bruno Windels
031f722540 clarify that we only get joined members for now 2018-08-15 11:59:39 +02:00
Bruno Windels
531ccf1819 actually, comment should be 1 line higher 2018-08-15 11:59:39 +02:00
Bruno Windels
0d2ac42dc4 add comment to clarify corners cut in prototype 2018-08-15 11:59:39 +02:00
Bruno Windels
008d85ed32 pick joined property out of response 2018-08-15 11:59:39 +02:00
Bruno Windels
5e30aff418 more consistent naming 2018-08-15 11:59:39 +02:00
Bruno Windels
5de0d39553 move the fact that we're prototyping only with joined members up the stack to client
only MatrixClient really needs to know that for now we only load joined members, the rest of the code can be generic for other membership types as that is the eventual plan, to also support invites at least.
2018-08-15 11:59:39 +02:00
Bruno Windels
d95d44dc94 move error handling to caller 2018-08-15 11:59:39 +02:00
Bruno Windels
9a796f1383 fix lint errors 2018-08-15 11:59:39 +02:00
Bruno Windels
2c5cad71ee prototype support for lazily loading members in matrixclient 2018-08-15 11:59:39 +02:00
David Baker
89ad104423 Add getSyncStateData()
To get additional information about the sync state (ie. the error
object).
2018-08-03 18:00:52 +01:00
Michael Telatynski
eaa2fdec44 Merge pull request #642 from matrix-org/t3chguy/doc_fixes
fix some documentation typos
2018-06-08 12:17:48 +01:00
Luke Barnard
bafbe5cbec Emit no_consent when M_CONSENT_NOT_GIVEN received (#647) 2018-05-22 18:02:21 +01:00
Michael Telatynski
7d468ee148 Replies (#607) (and Content Helpers)
* if event has `m.relates_to` extract this into the e2e-wrapper event

* Split out helpers to make content for {HTML,text}{emote,notice,message}
So that additional content fields can be added before sending

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-23 14:26:40 +01:00
Michael Telatynski
260e7b529f fix some documentation typos
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-15 23:31:33 +01:00
David Baker
c7052f7dc7 Remove not very useful but veryv spammy log line 2018-03-27 18:21:03 +01:00
Richard Lewis
8ff78c5d60 Switch event type to m.sticker. 2018-03-12 13:56:50 +00:00
Luke Barnard
68b230a78f Add function to cancel and resend key request (#624) 2018-03-08 15:01:01 +00:00
David Baker
5f12d858eb Keep a push processor and re-use it. (#622)
Because it does some nice caching stuff but that's no good if we
re-create a new one each time.
2018-03-06 19:01:30 +00:00
Richard Lewis
d98c803b54 Merge pull request #618 from matrix-org/rxl881/stickers
Fix JS doc
2018-02-23 15:52:42 +00:00
Matthew Hodgson
4fed2ea7bf log event IDs of ignored calls 2018-02-20 12:38:12 +00:00
Richard Lewis
1dfde7cd80 Fix JS doc 2018-02-08 11:17:55 +00:00
David Baker
47dfb4b8cd Merge pull request #597 from matrix-org/dbkr/e2e_rooms_indexeddb
Migrate room encryption store to crypto store
2018-02-06 10:29:29 +00:00
David Baker
51e782b671 Merge pull request #600 from matrix-org/t3chguy/fix_3pid_dm_rooms
add parameter to getIdentityServerUrl to strip the protocol for invites
2018-02-05 12:07:31 +00:00
David Baker
b6cd826dd7 basically I just can't type 2018-01-31 17:33:35 +00:00
David Baker
f1194b1fbe more comment grammar 2018-01-31 17:33:02 +00:00
David Baker
c0ca85fb3a comment grammar 2018-01-31 17:32:12 +00:00
Michael Telatynski
d007eefe2e add parameter to getIdentityServerUrl to strip the protocol for invites
use new getIdentityServerUrl param in inviteByThreePid
2018-01-25 09:53:19 +00:00
David Baker
e72096328a Actually working migration 2018-01-22 17:46:13 +01:00
David Baker
c360dd11ed Migrate e2e rooms to crypto store
Doesn't do data migration yet
2018-01-22 15:48:53 +01:00
David Baker
eeb97f5b66 Merge pull request #592 from matrix-org/dbkr/set_event_error
Set event error before emitting
2018-01-09 18:08:12 +00:00
David Baker
b6f26ae6a5 Oops: new year, new company 2018-01-09 18:05:02 +00:00
Richard Lewis
f40435654a Merge pull request #590 from matrix-org/rxl881/stickers
Add event type for stickers [WIP]
2018-01-09 14:49:05 +00:00
David Baker
67d471ea3d Also happy new year and all that 2018-01-09 13:24:29 +00:00
David Baker
4946c5e687 Set event error before emitting
So the event object properties are in a consistent state when we
the event is emitted.

Fixes first part of https://github.com/vector-im/riot-web/issues/5936
2018-01-09 13:23:04 +00:00
Richard Lewis
aef27d811a Set sticker type on event instead of message type. 2018-01-06 00:13:24 +00:00
Richard Lewis
d44d63c1d6 Send sticker message in to a room. 2018-01-04 21:55:20 +00:00
David Baker
d397c5a251 Merge pull request #586 from matrix-org/dbkr/crypto_store_migrate_warning
Emit an event for crypto store migration
2017-12-08 18:17:23 +00:00
David Baker
d26b4434b8 Merge pull request #575 from matrix-org/dbkr/udd_no_auto_show
Supporting fixes For making UnknownDeviceDialog not pop up automatically
2017-12-08 16:33:18 +00:00
David Baker
8f57723b88 Emit an event for crypto store migration
As we may want to warn the user to not go back to an older version.
2017-12-06 15:24:29 +00:00
David Baker
c31ce641a1 Merge branch 'master' into develop 2017-11-17 15:57:22 +00:00
David Baker
eb2d5484b8 jsdoc and remove pointless return 2017-11-17 15:31:50 +00:00