Commit graph

2336 commits

Author SHA1 Message Date
Brian Meek 0fe5ea6c32
After discovering the full path using the go nm tool, properly set the ReleaseVersion in the clientapi router
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-17 14:10:36 -07:00
Tak Wai Wong 0ef2a3960d
Make the fix for #2718 the same as dendrite main (#31)
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-09-16 16:30:31 -07:00
Brian Meek d7dc087953
Add commit ReleaseVersion to routing to return to clients in version request
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-16 13:28:03 -07:00
Brian Meek b95657fe94
Add commit hash to routing version API, TODO placeholder
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-15 15:12:56 -07:00
Brian Meek f681e54bef
Add commit hash to routing version API
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-15 15:00:36 -07:00
Tak Wai Wong 333a5c74c8
Temporary fix for appservice txnid (Dendrite issue #2718) (#29)
* temporary fix for dendrite regression #2718

* Change comment to match with dendrite main pr

* renamed zion-registration.yaml to zion-appservice.yaml. Change gitignore to ignore this file.

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-09-15 13:49:05 -07:00
Brian Meek 6ffe8147f5
Add commit hash to version API
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-15 12:17:41 -07:00
texuf 46f0ed379a Hack out read receipt de-duping protection
zion hack - always send the notification data on a read receipt
the notifications are stored in two different databases, and somehow the notification database
prunes data, so trying to mark old notifications as read will fail, but the notification will still exist in the other db
todo, revist when this refactor lands: https://github.com/matrix-org/dendrite/pull/2688/files

 it looks like we cleanup the notification table after a day

func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
	_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
		ctx,
		time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day
		time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month
	)
	return err
}
But we don't clean up the notifications in the syncAPI table.

When we send a read receipt we first do a updated _, err := s.db.SetNotificationsRead(ctx, localpart, roomID, int64(read.Read), true) and only forward the message on if the table was updated. If a user waits more than a day to send a read receipt, they can't clear their notifications.
2022-09-15 10:33:39 -07:00
texuf 087b3b2344 Fix broken notification incremental sync
I was not seeing unread notifications in sync, even if they were written to the db

Notifications are in their own stream, but the code was trying to tack them onto the join room stream. If the offsets “happened” to line up, you might get a count here or there, but they would be totally wrong (jump from 1 to 0 to 2, etc)

To fix, put them in their own top level object, handle them on the client.

Signed-off-by: Austin Ellis <austin@hntlabs.com>
2022-09-13 15:48:47 -07:00
Brian Meek 9b479dd3bb
Fix test checking which clients connected
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-09 19:04:37 -07:00
Brian Meek f8b419a4c1
Fix test checking which clients connected
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-09 17:45:01 -07:00
Brian Meek 45c604f563
Merge upstream
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-09 17:11:09 -07:00
Till Faelligen af9a204cc0 Only verify if fulltext indexing is enabled 2022-09-09 17:19:29 +02:00
Neil Alexander e8687f6f82
Version 0.9.7 (#2707)
Changelog and version bump.
2022-09-09 15:01:13 +01:00
Neil Alexander 955e69a3b7
Optimise SharedUsers again by using complete composite index 2022-09-09 14:18:45 +01:00
Neil Alexander 6ee758df63
Optimise shared users query in Synx API slightly by removing a potential sort 2022-09-09 13:50:50 +01:00
Neil Alexander e1bc4f6a1e
Fix database transaction for keyserver DeleteDeviceKeys 2022-09-09 13:31:55 +01:00
Neil Alexander c0e17bbe1b
Fix transactions around assigning NIDs 2022-09-09 13:30:09 +01:00
Till 8196b29657
Change detection of already executed migrations (#2665)
This changes the detection of already executed migrations for the
roomserver state block and keychange refactor. It now uses schema tables
provided by the database engine to check if the column was already
removed. We now also store the migration in the migrations table.

This should stop e.g. Postgres from logging errors like `ERROR: column
"event_nid" does not exist at character 8`.
2022-09-09 13:14:52 +01:00
Neil Alexander 646de03d60
More writer fixes in the Sync API 2022-09-09 13:06:42 +01:00
Neil Alexander 34e1dc210b
Use database writer in user API DeleteOldNotifications 2022-09-09 12:59:28 +01:00
Till 64472d9aab
Update getting pushrules, add tests, tweak pushrules (#2705)
This PR
- adds tests for `evaluatePushrules`
- removes the need for the UserAPI on the `OutputStreamEventConsumer`
(for easier testing)
- adds a method to get the pushrules from the database
- adds a new default pushrule for `m.reaction` events (and some other
tweaks)
2022-09-09 13:56:33 +02:00
Till 42a82091a8
Fix issue with stale device lists (#2702)
We were only sending the last entry to the worker, so most likely missed
updates.
2022-09-08 12:03:44 +02:00
Till d5876abbe9
Fulltext implementation incl. config (#2480)
This adds the main component of the fulltext search.
This PR doesn't do anything yet, besides creating an empty fulltextindex
folder if enabled. Indexing events is done in a separate PR.
2022-09-07 18:15:54 +02:00
Neil Alexander 31f4ae8997
Use a single context instead 2022-09-07 16:24:43 +01:00
Neil Alexander 5014b35bd7
Update state reset capture to Sentry 2022-09-07 16:23:22 +01:00
Till 0d697f6754
Add HTTP status code to FederationClientError (#2699)
Also ensures we wait on more HTTP status codes.
2022-09-07 16:14:09 +02:00
Till 7e8c605f98
Avoid unneeded JSON operations (#2698)
We were `json.Unmarshal`ing the EDU and `json.Marshal`ing right before
sending the EDU to the stream. Those are now removed and the consumer
does `json.Unmarshal` once.
2022-09-07 12:16:04 +02:00
Till Faelligen 4e352390b6
Re-add waitTime if we're not blacklisted and no RetryAfter was
specified.
2022-09-07 12:13:02 +02:00
Till 2cfcfddecc
Add a SigningKeyUpdate producer (#2697)
This adds a new stream for signing key updates, this should ensure we
don't lose any updates over federation.
2022-09-07 11:45:12 +02:00
Till 440eb0f3a2
Handle errors differently in the DeviceListUpdater (#2695)
`If a device list update goes missing, the server resyncs on the next
one` was failing because a previous test would receive a `waitTime` of
1h, resulting in the test timing out.
This now tries to handle the returned errors differently, e.g. by using
the default `waitTime` of 2s. Also doesn't try further users in the
list, if one of the errors would cause a longer `waitTime`.
2022-09-07 11:44:27 +02:00
Neil Alexander 847032df36
Update to matrix-org/gomatrixserverlib@637a173 2022-09-07 09:11:36 +01:00
Neil Alexander 489ccc1c60
Stronger default power levels 2022-09-06 17:25:17 +01:00
Neil Alexander 70cd9a902c
State resolution fixes in applyAndAuthEvent (update to matrix-org/gomatrixserverlib#336) 2022-09-06 17:19:21 +01:00
Neil Alexander fd7661f69c
Tweak Sentry again 2022-09-05 17:37:17 +01:00
Neil Alexander 5992b4c7ed
Set Sentry user where known 2022-09-05 17:35:43 +01:00
Neil Alexander cd22ba22b0
Improve Sentry reporting 2022-09-05 17:25:11 +01:00
Neil Alexander ecee5f10f4
Tweak logging for detected state resets 2022-09-05 17:08:54 +01:00
Neil Alexander bea3dbe77b
State and auth tweaks (update to matrix-org/gomatrixserverlib#335) 2022-09-05 17:00:54 +01:00
Neil Alexander 1c1d09abd4
Optimise resolve-state tool 2022-09-05 14:17:04 +01:00
Neil Alexander d1f87e63f1
Move SetLatestEvents call 2022-09-05 13:16:14 +01:00
Brian Meek cf5282d83e
Update ReadAll to use non-deprecated version
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-03 09:46:44 -07:00
Brian Meek d13085792c Update golint and go versions
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-03 09:04:35 -07:00
Brian Meek e228441e60
Merge branch 'matrix-org:main' into main 2022-09-02 23:10:09 -07:00
Brian Meek 60f6e4630f
Fix mispelling in comment
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-02 15:15:10 -07:00
Brian Meek d3cd37a792
Add a delay before finishing the loadAndRunTests and destroying the dendrite docker container
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-02 15:05:15 -07:00
Brian Meek b04b637d66
Log events as string that are found when the dendrite-upgrade-tests fail to aid debugging
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-02 14:41:45 -07:00
Brian Meek e1ce3f0458
Log events that are found when the dendrite-upgrade-tests fail to aid debugging
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-02 14:03:47 -07:00
Brian Meek 973f949304
Update dependencies to see if it helps make tests more reliable, easier to debug
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-02 12:45:43 -07:00
Till 350a5e5393
Only send (invite) events to the AS if it's interested in it (#2692)
This should hopefully fix #2691 (and maybe also #2690)
2022-09-02 16:03:33 +02:00