Commit graph

1387 commits

Author SHA1 Message Date
Neil Alexander d70ebaa1b9
Fixes 2021-01-08 13:36:08 +00:00
Neil Alexander e96185bbc0
Fix invite position 2021-01-08 11:19:40 +00:00
Neil Alexander 85e6b646c9
Re-add notifier 2021-01-08 11:00:37 +00:00
Neil Alexander 0aa91059a9
Tweaks 2021-01-07 17:21:07 +00:00
Neil Alexander e91d71ebca
Remove some fmt.Println 2021-01-07 17:08:56 +00:00
Neil Alexander 4506b50828
Limit fixes, amongst other things 2021-01-07 16:59:35 +00:00
Neil Alexander ac525fba47
Use limit for incremental sync 2021-01-07 15:58:48 +00:00
Neil Alexander 076ef91a48
Advance account data position 2021-01-07 15:11:24 +00:00
Neil Alexander ff22d71de6
Device list updates 2021-01-07 14:57:56 +00:00
Neil Alexander fb90ca074e
Don't advance position on remove again unless needed 2021-01-07 14:23:38 +00:00
Neil Alexander 0465f523cb
Fix typing positions 2021-01-07 14:23:09 +00:00
Neil Alexander a6549669ca
More lightweight notifications 2021-01-07 13:48:32 +00:00
Neil Alexander 875cb2c379
Don't drop errors 2021-01-07 12:03:53 +00:00
Neil Alexander 89e0d0f124
Complete sync send-to-device 2021-01-07 11:21:05 +00:00
Neil Alexander f1a6fb2ece
Clean up a bit 2021-01-07 11:19:10 +00:00
Neil Alexander 6929b8a4ec
Streams package 2021-01-07 11:09:52 +00:00
Neil Alexander 98707e1554
Fix complete sync for receipt, typing 2021-01-07 09:31:40 +00:00
Neil Alexander 3843d076bc
End of day 2021-01-06 17:29:07 +00:00
Neil Alexander af6b07e1b4
Add account data stream/position 2021-01-06 17:17:57 +00:00
Neil Alexander c31a1767f7
Don't reset next batch position on timeout 2021-01-06 17:05:42 +00:00
Neil Alexander 722510ac9f
Fix timed out syncs 2021-01-06 16:58:07 +00:00
Neil Alexander a588f9061b
Log tweaks, typing fixed? 2021-01-06 16:54:27 +00:00
Neil Alexander 9ead2d96e2
Use addRoomDeltaToResponse 2021-01-06 16:07:59 +00:00
Neil Alexander af332f24ae
Add some more wakeups 2021-01-06 15:36:53 +00:00
Neil Alexander 2eb4efca44
Bring forward some more PDU logic, clean up other places 2021-01-06 15:30:20 +00:00
Neil Alexander 6da5ebfadf
Don't leak channels 2021-01-06 14:38:31 +00:00
Neil Alexander cbaeff6096
Clean up, add templates for other streams 2021-01-06 14:37:09 +00:00
Neil Alexander aa0126f607
Dedupe a bit, add a template for the invite stream 2021-01-06 13:43:28 +00:00
Neil Alexander 954b36a74c
Delete notifier, other tweaks 2021-01-06 13:05:36 +00:00
Neil Alexander 721a40edb0
Fix bugs, add receipt stream 2021-01-06 11:40:52 +00:00
Neil Alexander cac9f758dc
Other tweaks, typing works 2021-01-06 11:12:46 +00:00
Neil Alexander b353c039ff
Wakeups largely working 2021-01-06 10:17:34 +00:00
Neil Alexander 475ae4ca3b
It's half-alive 2021-01-05 17:22:27 +00:00
Jason Robinson e3ce6a924f
Add MSC's section to example config (#1675)
The config section for MSC's was missing from the example config. Even though these are experimental features, it might be good to add the section into the example config for visibility.

Signed-off-by: Jason Robinson <mail@jasonrobinson.me>
2021-01-05 11:31:10 +00:00
Neil Alexander 05324b6861
Send/state tweaks (#1681)
* Check missing event count

* Don't use request context for /send
2021-01-04 13:47:48 +00:00
Jason Robinson 597350a67f
Ensure appservices can auth as users in their namespaces (#1672)
* Ensure appservices can auth as users in their namespaces

Currently in Dendrite appservices can only auth as a user if the user was created by said appservice. This does not align with the appservices spec which specifically says:

> The application service may specify the virtual user to act as through use of a user_id query string parameter on the request. The user specified in the query string must be covered by one of the application service’s user namespaces.

https://matrix.org/docs/spec/application_service/r0.1.2#identity-assertion

In the case that a user has been created for example via manual registration but belongs to an appservice namespace, the current functionality does not allow appservices to auth as them. This PR fixes that by replacing the appservice ID check with a check against the appservice namespace.

This also matches Synapse functionality, which I confirmed to allow appservices to auth as a user in their namespace, irregardless of how the user was registered.

* Also allow appservice itself to auth with user_id

Appservice user_id + access token check needs to work both when user_id is the appservice and when appservice has the user in their user namespace.

Signed-off-by: Jason Robinson <mail@jasonrobinson.me>
2021-01-04 10:43:23 +00:00
Will Hunt e7f2d770df
Update docker-compose.deps.yml to use postgres:11 (#1677) 2021-01-04 10:36:36 +00:00
6543 a85051ca9d
fix imports (#1665)
* fix imports

Signed-off-by: 6543 <6543@obermui.de>

* add sqlite driver import back

Signed-off-by: 6543 <6543@obermui.de>

* rm import of userapi/storage/accounts/sqlite3/storage.go
2020-12-21 14:27:01 +00:00
Neil Alexander 4a0461378a
Version 0.3.4 2020-12-18 14:53:31 +00:00
Neil Alexander 932ff6b166
Fix /register 2020-12-18 14:51:30 +00:00
Will Hunt e4d1f0958f
Do not check if a username is exclusive if the request is for an appservice in /register (#1652)
* Do not check if a username is exclusive if the request is for an appservice in /register

* remove useless comment

* Move statements

* fix broken test

* Also fix the senderLocalpart problem

* Check domain name is ours

* Handle accessTokenErr

* Return unauthorised instead of forbidden

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-12-18 14:36:59 +00:00
Neil Alexander 4fe4c180e6
Ensure we wake for our own device list updates (#1661)
* Make sure we wake up for our own key changes

* Whitelist 'Users receive device_list updates for their own devices'
2020-12-18 14:04:17 +00:00
Neil Alexander fac71edc62
Fix #1655 by re-adding the appservice alias query (#1660) 2020-12-18 13:33:28 +00:00
Neil Alexander 65ff5c9a2c
Don't send null in joined_rooms response (#1659) 2020-12-18 13:33:08 +00:00
Neil Alexander 50963b724b
More sane next batch handling, typing notification tweaks, give invites their own stream position, device list fix (#1641)
* Update sync responses

* Fix positions, add ApplyUpdates

* Fix MarshalText as non-pointer, PrevBatch is optional

* Increment by number of read receipts

* Merge branch 'master' into neilalexander/devicelist

* Tweak typing

* Include keyserver position tweak

* Fix typing next position in all cases

* Tweaks

* Fix typo

* Tweaks, restore StreamingToken.MarshalText which somehow went missing?

* Rely on positions from notifier rather than manually advancing them

* Revert "Rely on positions from notifier rather than manually advancing them"

This reverts commit 53112a62cc.

* Give invites their own position, fix other things

* Fix test

* Fix invites maybe

* Un-whitelist tests that look to be genuinely wrong

* Use real receipt positions

* Ensure send-to-device uses real positions too
2020-12-18 11:11:21 +00:00
Kegsay a518e2971a
Fix flakey complement (#1653) 2020-12-17 18:25:51 +00:00
Neil Alexander 9a1ef81fa2
Add CS sendevent metrics
Squashed commit of the following:

commit c38c39107b6dda0c8e6320d61da2365c47eea4e9
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu Dec 17 10:13:09 2020 +0000

    Update buckets

commit 5a3bcc8bd4167150374827b0e42a0dea0366beff
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu Dec 17 09:41:43 2020 +0000

    Update buckets

commit 78dff8165ddf596e28af04faf56466752ebc17af
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu Dec 17 09:37:27 2020 +0000

    Register sendEventDuration

commit 612b0f3d84f1547ff30131f7b084baf609edab52
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu Dec 17 09:35:59 2020 +0000

    sendevent metrics
2020-12-17 10:52:31 +00:00
Neil Alexander e1ace7e44a
Add event ID index on current state table (helps performance) (#1649) 2020-12-16 18:16:39 +00:00
Kegsay 76becac003
Add start_stream to /messages (#1648) 2020-12-16 18:10:39 +00:00
Kegsay 42e9cbf342
NOTSPEC: Make ?from= optional in /messages (#1647) 2020-12-16 17:31:03 +00:00