1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-10 21:23:02 +03:00
Commit Graph

299 Commits

Author SHA1 Message Date
Richard van der Hoff
b18a4ee16b client.js: Fix error handling in downloadKeys
Fix a bug in the error handling in downloadKeys: If the http request failed,
then the exception would get silently swallowed and the promise would never
resolve.

Also: tests!
2016-06-07 17:26:56 +01:00
Matthew Hodgson
0421e69f14 revert brand param at reg time 2016-06-02 12:33:09 +01:00
Matthew Hodgson
8b35ddae0a add 'brand' parameter to register() 2016-06-02 11:46:02 +01:00
David Baker
06486f7ad0 Fix c+p fails 2016-05-06 14:28:26 +01:00
David Baker
a9d8c58ea0 Add support for the openid interface 2016-05-06 13:58:10 +01:00
Richard van der Hoff
d87e5471fa Refactor the addition of events to rooms
... and add some sanity checks

Two things here:

1. Clean up the Room API for adding new events to the timeline. Where before
we had addEvents and addEventsToTimeline, whose purposes were unclear, we now
have addLiveEvents which must be used for adding events to the end of the live
timeline, and addEventsToTimeline which should be used for pagination (either
back-pagination of the live timeline, or pagination of an old timeline).

2. Add some sanity checks for the live timeline. Today we have seen problems
where somehow the live timeline had gained a forward pagination token, or the
live timeline had got joined to another timeline, leading to much confusion -
and I would like to notice these sooner.
2016-04-14 17:03:25 +01:00
Richard van der Hoff
950fce80c8 Whitespace fix
remove trailing ws
2016-04-14 16:09:51 +01:00
David Baker
dbc3a9a500 Merge pull request #125 from matrix-org/dbkr/get_pushers
Add methods to get (and set) pushers
2016-04-12 13:25:17 +01:00
David Baker
cff7c8a59f Add methods to get (and set) pushers 2016-04-12 13:11:00 +01:00
Matthew Hodgson
11e4760935 improve commentary 2016-04-08 22:00:07 +01:00
Matthew Hodgson
c469ff4c8d oops, fix sig 2016-04-03 01:19:34 +01:00
Matthew Hodgson
c7575f3f16 cache url preview results 2016-04-03 01:18:01 +01:00
Matthew Hodgson
415251dd70 WIP url previewing 2016-03-31 18:38:34 +01:00
Matthew Hodgson
e1415d9829 Merge pull request #117 from matrix-org/matthew/roomlist
get/setRoomVisibility API
2016-03-22 12:30:18 +00:00
Richard van der Hoff
19a12b3c79 Merge pull request #115 from matrix-org/rav/txnid_clashes
Include a counter in generated transaction IDs
2016-03-22 12:20:02 +00:00
Matthew Hodgson
bec41e4f94 incorporate review 2016-03-22 10:20:02 +00:00
Matthew Hodgson
5f177aeec4 get/setRoomVisibility API 2016-03-22 00:55:53 +00:00
Matthew Hodgson
fba4d5fb0a Merge pull request #114 from matrix-org/matthew/stop-peeking
API to stop peeking
2016-03-21 16:12:29 +00:00
Richard van der Hoff
dfc4b34d09 Include a counter in generated transaction IDs
Fixes a flaky test which sometimes failed due to sending two events in the same
millisecond.
2016-03-18 21:32:15 +00:00
Richard van der Hoff
ad9daecbd4 Pass the right options into SyncApi when peeking
When we peek into a room, we create its Room object. We need to make sure it is
created with the same options as we would if it were created via the /sync
calls.

Save the options passed in when startClient is called, and then pass them into
the SyncApi each time we create it.
2016-03-18 20:59:23 +00:00
Matthew Hodgson
d29302716d oops 2016-03-18 19:25:22 +00:00
Matthew Hodgson
6c7d13f8ce API to stop peeking 2016-03-18 19:22:34 +00:00
Richard van der Hoff
e15a2d138c Merge pull request #112 from matrix-org/rav/cancel_send
Support for cancelling pending events
2016-03-18 16:17:44 +00:00
Richard van der Hoff
8bc9c19278 Merge pull request #111 from matrix-org/rav/pending_event_list
Implement 'pendingEventList'
2016-03-18 16:17:30 +00:00
David Baker
ba1991aa8f Add more docs :) 2016-03-18 15:54:19 +00:00
David Baker
f4fd8d9ba6 Add a method to the js sdk to look up 3pids on the ID server. 2016-03-18 15:15:10 +00:00
Richard van der Hoff
02be0f659a Support for cancelling pending events
Implement client.cancelPendingEvent which will cancel queued or not_sent events
2016-03-17 22:15:46 +00:00
Richard van der Hoff
55d8f56f98 update docs 2016-03-17 17:53:20 +00:00
Richard van der Hoff
3c6bd4774d Refactor transmitted-messages code
This is some preparatory work for fixing up the problems with te timeline
ordering of unsent messages
(https://github.com/vector-im/vector-web/issues/1120). The functional changes
here should be minimal (bar an extra `Room.localEchoUpdated` when the local
echo is first added to the timeline).

Give `MatrixClient.sendEvent` its own entry point `Room.addPendingMessage`
instead of pushing it through `addEventsToTimeline`; this considerably
simplifies the implementation of the latter and also means that we can contain
the `_txnId` ming to MatrixClient.

Move the code which deals with a successful `/send` response from
`MatrixClient` into `Room.updatePendingEvent`, since it involves fiddling with
the innards of the Room.

Also adds a new EventStatus 'SENT' for events which have been successfully sent
but whose remote echo we still haven't received.
2016-03-17 14:26:36 +00:00
David Baker
6f7ed93b87 Merge pull request #100 from matrix-org/dbkr/session_logged_out
Add Session.logged_out event
2016-03-16 10:44:01 +00:00
Richard van der Hoff
07bbe358ea Clean up a codepath that was only used for crypto messages
Transmission of encrypted messages was happening somewhat differently to
normal messages. In particular, we weren't copying the 'unsigned' field when we
got the remote-echo, which meant the 'sync' code didn't correctly match up the
echo with the original.

The separate codepath was becoming a thorn in my side, so fix things up to
bring it back in line.
2016-03-15 15:07:26 +00:00
David Baker
5833654aa6 Add Session.logged_out event that fires whenever the current session is no longer valid and the user needs to log in again. Also null check _syncApi before trying to stop it. 2016-03-15 10:45:08 +00:00
Richard van der Hoff
4ae353d3d3 Raise localEchoUpdated events in more places
We need to know about more transitions for local-echo status changes, so raise
localEchoUpdated events for each transition.

Fixes an issue where we weren't turning failed transmissions red, because the
timeline wasn't being updated.
2016-03-10 12:07:27 +00:00
Mark Haines
066dd77aba Add setPushRuleActions method for setting the actions for push notification rules 2016-02-26 16:47:22 +00:00
David Baker
567716c4f7 Use more normal promise structure 2016-02-23 11:21:29 +00:00
David Baker
518e41c078 add docs 2016-02-23 11:08:07 +00:00
David Baker
bd600f65fb Add support for new keypair style 3pid invites (add an option to joinRoom for specifying the signing url) 2016-02-23 10:11:04 +00:00
Richard van der Hoff
24ae4a8d1a Interpret the response from /context correctly
events_before are backwards

Fixes https://github.com/vector-im/vector-web/issues/963
2016-02-19 17:03:47 +00:00
David Baker
4d46251b15 Just use the keepalive logic to recover from lost internet connections.
* This should fix the problem where we could end up with two concurrent syncs
   due to both retrying /sync and hitting /versions. There is now one and only
   one mechanism for connection recovery.
 * Hit /versions a little less often as I think every 2 seconds is a little
   over-aggressive. Also introduce randomness to minimize possibility of
   thundering herds.
 * Add a listener for the 'online' event in case any browser is nice enough
   to ever fire it.
 * Treat a 400 response from /versions as successful since older synapses
   will not support it.
2016-02-09 16:08:14 +00:00
David Baker
977e33f1bd Merge pull request #76 from matrix-org/dbkr/sync_gutwrench_less
Change the sync state tracking slightly to gut-wrench client a bit less
2016-02-08 14:18:59 +00:00
David Baker
daa0e6291e Add docs for STOPPED state and correct js doc 2016-02-08 14:18:15 +00:00
Daniel Wagner-Hall
02196416e4 Use /r0 or /unstable for all requests 2016-02-08 11:15:30 +00:00
Richard van der Hoff
76c79ec299 Check old timelines when looking for echoes of sent messages
After /send completes, we check the room to see if the echo has already come
back via /sync. It's a bit of an edge-case, but we ought to check all
timelines, not just the live one.

Furthermore, we now have a map from eventId to timeline, so we can handle the
case where the echo has *not* yet come back more efficiently than searching
through the whole timeline.
2016-02-05 17:31:46 +00:00
David Baker
41d5917bb6 Change the sync state tracking slightly to gut-wrench client a bit less
Should be functionally identical outside of client and sync.
2016-02-05 14:09:58 +00:00
Richard van der Hoff
f3e5e03009 Give precedence to later Read Receipts
In order to resolve the conflict between local and remote read-receipts, try to
give precedence to the read-receipt which refers to the most recent event.

Also fix the read-receipt synthesis in _addLiveEvents so that it actually works
(drop the spurious MatrixEvent wrapper), and remove the synthesis in
recalculate() (which appears to be redundant).
2016-02-04 15:35:27 +00:00
David Baker
8a77b29d17 Add docs to getRoom noting how you shouldn't assume it will return something because you've got a Room-like event 2016-02-02 16:30:28 +00:00
Richard van der Hoff
3c2fad7c8d Merge remote-tracking branch 'origin/develop' into rav/context 2016-01-27 09:49:00 +00:00
Richard van der Hoff
a87cefa035 Replace the boolean args on EventTimeline methods with constants 2016-01-26 22:38:26 +00:00
David Baker
15e8784daf Add local echo for read receipts. Fixes https://github.com/vector-im/vector-web/issues/623 2016-01-25 17:49:41 +00:00
Richard van der Hoff
840b8f0bc0 Merge branch 'develop' into rav/context
Conflicts:
	lib/models/room.js
2016-01-25 10:45:22 +00:00