-
-
Notifications
You must be signed in to change notification settings - Fork 678
de-MSC-ifying space summaries (MSC2946) #3134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall things are looking really good and in the right place!
- Opt for referring to it as 'room hierarchies', reflecting the route - Split msc2945.go across clientapi and roomserverapi - Still TODO fed api - Some other TODOs still to do
- still need to rename some identifiers from GMSL
- A few commits ago we moved `Queryer` to be init when fed API is set - This causes Queryer to be nil before it is set - Causes nil error in `userapi.NewInternalAPI` - Rearrange to avoid this
41b5fc0
to
ad1de7d
Compare
(rebase on main) |
Add some constants used in space summaries / room hierarchy ( matrix-org/dendrite#3134 ) ### Pull Request Checklist * [x] Pull request includes a [sign off](https://github.com/matrix-org/dendrite/blob/master/docs/CONTRIBUTING.md#sign-off) Signed-off-by: `Sam Wedgwood <[email protected]>`
I've opened this PR up to review now, but just a few things to note:
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3134 +/- ##
==========================================
- Coverage 65.28% 64.55% -0.73%
==========================================
Files 504 506 +2
Lines 56389 56992 +603
==========================================
- Hits 36814 36794 -20
- Misses 15770 16390 +620
- Partials 3805 3808 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
- CSAPI used wrong function to create pagination cache (which caused nil map errs) - Copied an array wrong in room hierarchy impl, which caused a nil room list to return
- internal room hierarchy function should treat -1 as no limit, it wasnt
type DeviceOrServerName struct { | ||
device *userapi.Device | ||
serverName *spec.ServerName | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this type? NewDeviceNotServerName never seems to be used, we only use the servername variant. In which case the code that uses this should just take a spec.ServerName.
Or am I overlooking a use case somewhere? I'd prefer not to have a type like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this type because room hierarchy querying has slightly different authorisation logic depending on whether you call it from the client API or the server API. NewDeviceNotServerName
is used in the client api clientapi/routing/room_hierarchy.go
. Annoyingly Go doesn't have any concept of sum types so I improvised a bit
- to use new symbols from matrix-org/gomatrixserverlib#403 that don't mention MSC2946
be7fba6
to
51aafae
Compare
Remove mentions of MSC2946, as it it part of the spec. (For matrix-org/dendrite#3134 ). Signed-off-by: `Sam Wedgwood <[email protected]>`
Add some constants used in space summaries / room hierarchy ( matrix-org/dendrite#3134 ) ### Pull Request Checklist * [x] Pull request includes a [sign off](https://github.com/matrix-org/dendrite/blob/master/docs/CONTRIBUTING.md#sign-off) Signed-off-by: `Sam Wedgwood <[email protected]>`
Remove mentions of MSC2946, as it it part of the spec. (For matrix-org/dendrite#3134 ). Signed-off-by: `Sam Wedgwood <[email protected]>`
This PR moves and refactors the code for MSC2946 ('Space Summaries') to integrate it into the rest of the codebase.
Solves #3096
Pull Request Checklist
Signed-off-by: Sam Wedgwood [email protected]