dendrite/src/github.com/matrix-org/dendrite/common
Andrew Morgan 7736e247b7
Send Application Service Events (#477)
* Prevent sql scanning into nil value in accounts_table

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* Remove uneccessary logging, null checking

* Don't forget to set the localpart

* Simplify error checking

* Store And Send Application Service Events

* Modify INSTALL.md and dendrite-config.yaml for the new appservice database
* Correct all instances of casing on 'application service' to align with
spec
* Store incoming events that an app service is interested in in the
database to be later read by transaction workers.
* Retrieve these events from transaction workers, one per AS.
* Minimal transaction ID data is stored as well to recover after
server failure.
* Send events to AS and exponentially backoff on failure.

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* Finish my own sentences.

* Fix up database interaction

* Change to event-based AS sending

* Reduce cyclomatic complexity

* Appease the errcheck gods

* Delete by int ID instead of string.

This was causing some events to not be deleted, as < an eventID doesn't
really make much sense.

* Check if there are more events to send before sleeping

* Send same transaction if last send attempt failed

* Don't backoff on non-200s, tight send loop, 1 event query

* Remove tight send loop. Fix events not being deleted

* Additionally order by event id, track main.go

* Return the last txnID, which our events are using

* Remove old main.go file

* Prevent duplicate events from being sent...

* Strip event content if it doesn't contain anything

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* Update gomatrixserverlib and use Unsigned AS event prop

* Fixes

* Fix sync server comment
* Remove unnecessary printlns
* Use logrus Fields
* Worker state methods
* Remove sillyness

* Fix up event filtering

* Handle transaction event limit in loop

* Switch to using a sequence for transaction IDs

* Don't verify self-signed AS certificates

* Fix logging

* Use gmsl.Event instead of AS-only event in transactions

Also clear up the logic on lookupStateEvents a little bit.

* Change invalid_txn_id to global (for efficiency)

* Use a bool for EventsReady instead of an int
2018-07-05 09:34:59 -07:00
..
basecomponent Update Prometheus metrics tracking (#459) 2018-05-23 15:42:08 +01:00
config Send Application Service Events (#477) 2018-07-05 09:34:59 -07:00
keydb Update gomatrixserverlib version (#476) 2018-06-01 17:42:55 +01:00
test Fix linting errors in go1.9.1 (#336) 2017-11-15 11:13:09 +00:00
transactions Add module for transactions cache (#440) 2018-05-16 11:36:40 +01:00
consumers.go Add context to the partition offset table (#249) 2017-09-21 15:09:19 +01:00
eventcontent.go Processing of pending invites on 3PID binding (#218) 2017-09-08 15:17:12 +01:00
events.go Fix typo 2017-11-29 09:48:55 +00:00
httpapi.go Update Prometheus metrics tracking (#459) 2018-05-23 15:42:08 +01:00
log.go Enable debug logs using a configuration parameter and put all logs in a single file (#379) 2018-04-10 13:21:20 +01:00
partition_offset_table.go Add context to the partition offset table (#249) 2017-09-21 15:09:19 +01:00
sql.go User registration return M_USER_IN_USE when username is already taken (#372) 2017-12-19 09:49:42 +00:00
types.go Federation: Implement Query Profile API (#317) 2017-11-05 14:03:54 -04:00