-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Send to-device messages to application services #11215
Commits on Nov 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 7fbfedb - Browse repository at this point
Copy the full SHA 7fbfedbView commit details -
Add a new ephemeral AS handler for to_device message edus
Here we add the ability for the application service ephemeral message processor to handle new events on the "to_device" stream. We keep track of a stream id (token) per application service, and every time a new to-device message comes in, for each appservice we pull the messages between the last-recorded and current stream id and check whether any of the messages are for a user in that appservice's user namespace. get_new_messages is implemented in the next commit. since we rebased off latest develop.
Configuration menu - View commit details
-
Copy full SHA for b7a44d4 - Browse repository at this point
Copy the full SHA b7a44d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 78bd5ea - Browse repository at this point
Copy the full SHA 78bd5eaView commit details -
Add database method to fetch to-device messages by user_ids from db
This method is quite similar to the one below, except that it doesn't support device ids, and supports querying with more than one user id, both of which are relevant to application services. The results are also formatted in a different data structure, so I'm not sure how much we could really share here between the two methods.
Configuration menu - View commit details
-
Copy full SHA for 7899f82 - Browse repository at this point
Copy the full SHA 7899f82View commit details -
Add a to_device_stream_id column to the application_services_state table
This is for tracking the stream id that each application service has been sent up to. In other words, there shouldn't be any need to process stream ids below the recorded one here as the AS should have already received them. Note that there is no reliability built-in here. Reliability of delivery if intended for a separate PR.
Configuration menu - View commit details
-
Copy full SHA for 103f410 - Browse repository at this point
Copy the full SHA 103f410View commit details -
I decided to spin up another test class for this as the existing one is 1. quite old and 2. was mocking away too much of the infrastructure to my liking. I've named the new class alluding to ephemeral messages, and while we already have some ephemeral tests in AppServiceHandlerTestCase, ideally I'd like to migrate those over. There's two new tests here. One for testing that to-device messages for a local user are received by any application services that have registered interest in that user - and that those that haven't won't receive those messages. The next test is similar, but tests with a whole bunch of to-device messages. Rather than actually registering tons of devices - which would make for a very slow unit test - we just directly insert them into the database.
Configuration menu - View commit details
-
Copy full SHA for e914f1d - Browse repository at this point
Copy the full SHA e914f1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2930fe6 - Browse repository at this point
Copy the full SHA 2930fe6View commit details
Commits on Nov 19, 2021
-
Make msc2409_to_device_messages_enabled private; remove unnecessary c…
…heck The second check for self._msc2409_to_device_messages_enabled was not necessary. It's already checked in notify_interested_services_ephemeral earlier.
Configuration menu - View commit details
-
Copy full SHA for f65846b - Browse repository at this point
Copy the full SHA f65846bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ce020c3 - Browse repository at this point
Copy the full SHA ce020c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f1183c - Browse repository at this point
Copy the full SHA 8f1183cView commit details -
Deduplicate ephemeral events to send conditional
Test cases needed to be updated, as we now always call submit_ephemeral_events_for_as, it may just be with an empty events list.
Configuration menu - View commit details
-
Copy full SHA for 401cb2b - Browse repository at this point
Copy the full SHA 401cb2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 179dd5a - Browse repository at this point
Copy the full SHA 179dd5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b0bbc1 - Browse repository at this point
Copy the full SHA 8b0bbc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 31c4b40 - Browse repository at this point
Copy the full SHA 31c4b40View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd9d963 - Browse repository at this point
Copy the full SHA bd9d963View commit details
Commits on Nov 22, 2021
-
There is so much mocking going on here. I look forward to replacing these one day.
Configuration menu - View commit details
-
Copy full SHA for 8f8226a - Browse repository at this point
Copy the full SHA 8f8226aView commit details
Commits on Nov 24, 2021
-
Configuration menu - View commit details
-
Copy full SHA for b4a4b45 - Browse repository at this point
Copy the full SHA b4a4b45View commit details -
Configuration menu - View commit details
-
Copy full SHA for c691ef0 - Browse repository at this point
Copy the full SHA c691ef0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cf6ad9 - Browse repository at this point
Copy the full SHA 7cf6ad9View commit details
Commits on Dec 3, 2021
-
Refactor and generalise the sending of arbitrary fields over AS trans…
…actions Things were starting to get a little inflexible as we kept adding new types of data to send to application services. It's better to just have one method for adding data to AS transactions, than one for each type of data. Note that subsequent PRs will need to add device lists, one-time keys and fallback keys to these transactions. Adding those are additional arguments to a method is much nicer than a new method for each one. Plus with this setup we can add multiple different types of data at once without kicking off an AS transaction for each type. This will be useful for OTK/fallback keys, as we plan to lazily attach those when handling other event types.
Configuration menu - View commit details
-
Copy full SHA for 6d68b8a - Browse repository at this point
Copy the full SHA 6d68b8aView commit details -
Fix tests to mock _TransactionController.send of ApplicationServiceSc…
…heduler.enqueue* With enqueue_for_appservice being called per-event per-appservice, it's not a great target for mocking. So we use _TransactionController.send instead, to track things that are actually sent out to AS's. This also has the benefit of testing a wider bit of the AS txn pipeline
Configuration menu - View commit details
-
Copy full SHA for 13b25cf - Browse repository at this point
Copy the full SHA 13b25cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 275e1e0 - Browse repository at this point
Copy the full SHA 275e1e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 403490d - Browse repository at this point
Copy the full SHA 403490dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 385b3bf - Browse repository at this point
Copy the full SHA 385b3bfView commit details
Commits on Dec 7, 2021
-
Configuration menu - View commit details
-
Copy full SHA for c0b157d - Browse repository at this point
Copy the full SHA c0b157dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ba91438 - Browse repository at this point
Copy the full SHA ba91438View commit details
Commits on Jan 11, 2022
-
Update synapse/storage/schema/main/delta/65/06_msc2409_add_device_id_…
…appservice_stream_type.sql Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 0685021 - Browse repository at this point
Copy the full SHA 0685021View commit details -
Configuration menu - View commit details
-
Copy full SHA for e7f6732 - Browse repository at this point
Copy the full SHA e7f6732View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d1661f - Browse repository at this point
Copy the full SHA 3d1661fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ac079b - Browse repository at this point
Copy the full SHA 0ac079bView commit details
Commits on Jan 25, 2022
-
Refactor storage methods to retrieve to-device messages
This commit refactors the previously rather duplicated 'get_new_messages_for_device' and 'get_new_messages' methods into one new private method with combined logic, and two small public methods. The public methods expose the correct interface for querying to-device messages for either a single device (where a limit can be used) and multiple devices (where using a limit is infeasible).
Configuration menu - View commit details
-
Copy full SHA for 822e92a - Browse repository at this point
Copy the full SHA 822e92aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 25488fa - Browse repository at this point
Copy the full SHA 25488faView commit details
Commits on Jan 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 026cb8a - Browse repository at this point
Copy the full SHA 026cb8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1121674 - Browse repository at this point
Copy the full SHA 1121674View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8129657 - Browse repository at this point
Copy the full SHA 8129657View commit details -
Configuration menu - View commit details
-
Copy full SHA for de48ab4 - Browse repository at this point
Copy the full SHA de48ab4View commit details -
Configuration menu - View commit details
-
Copy full SHA for d8b8f74 - Browse repository at this point
Copy the full SHA d8b8f74View commit details
Commits on Jan 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ced1314 - Browse repository at this point
Copy the full SHA ced1314View commit details -
Configuration menu - View commit details
-
Copy full SHA for c749fcb - Browse repository at this point
Copy the full SHA c749fcbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24512fb - Browse repository at this point
Copy the full SHA 24512fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24bc3c5 - Browse repository at this point
Copy the full SHA 24bc3c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30b74a5 - Browse repository at this point
Copy the full SHA 30b74a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80c3721 - Browse repository at this point
Copy the full SHA 80c3721View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d8e50d - Browse repository at this point
Copy the full SHA 3d8e50dView commit details -
Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 50ebcb9 - Browse repository at this point
Copy the full SHA 50ebcb9View commit details
Commits on Jan 31, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 089e041 - Browse repository at this point
Copy the full SHA 089e041View commit details
Commits on Feb 1, 2022
-
Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for d06781e - Browse repository at this point
Copy the full SHA d06781eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c334eef - Browse repository at this point
Copy the full SHA c334eefView commit details -
Configuration menu - View commit details
-
Copy full SHA for bf93ec4 - Browse repository at this point
Copy the full SHA bf93ec4View commit details