Fix /context with lazy_load_members (#2277)

* Add membership events to the end of the list, to ensure Sytest sees them

* Move tests to allowlist

* Append to correct list, fix logging message

* Add flakey tests to blacklist

* Remove flakey tests from whitelist
This commit is contained in:
S7evinK 2022-03-14 20:04:24 +01:00 committed by GitHub
parent 01d71a767d
commit a2cf1aaf48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -66,7 +66,7 @@ func Context(
membershipRes := roomserver.QueryMembershipForUserResponse{} membershipRes := roomserver.QueryMembershipForUserResponse{}
membershipReq := roomserver.QueryMembershipForUserRequest{UserID: device.UserID, RoomID: roomID} membershipReq := roomserver.QueryMembershipForUserRequest{UserID: device.UserID, RoomID: roomID}
if err = rsAPI.QueryMembershipForUser(ctx, &membershipReq, &membershipRes); err != nil { if err = rsAPI.QueryMembershipForUser(ctx, &membershipReq, &membershipRes); err != nil {
logrus.WithError(err).Error("unable to fo membership") logrus.WithError(err).Error("unable to query membership")
return jsonerror.InternalServerError() return jsonerror.InternalServerError()
} }
@ -158,17 +158,19 @@ func applyLazyLoadMembers(filter *gomatrixserverlib.RoomEventFilter, eventsAfter
} }
newState := []*gomatrixserverlib.HeaderedEvent{} newState := []*gomatrixserverlib.HeaderedEvent{}
membershipEvents := []*gomatrixserverlib.HeaderedEvent{}
for _, event := range state { for _, event := range state {
if event.Type() != gomatrixserverlib.MRoomMember { if event.Type() != gomatrixserverlib.MRoomMember {
newState = append(newState, event) newState = append(newState, event)
} else { } else {
// did the user send an event? // did the user send an event?
if x[event.Sender()] { if x[event.Sender()] {
newState = append(newState, event) membershipEvents = append(membershipEvents, event)
} }
} }
} }
return newState // Add the membershipEvents to the end of the list, to make Sytest happy
return append(newState, membershipEvents...)
} }
func parseRoomEventFilter(req *http.Request) (*gomatrixserverlib.RoomEventFilter, error) { func parseRoomEventFilter(req *http.Request) (*gomatrixserverlib.RoomEventFilter, error) {

View File

@ -24,7 +24,6 @@ Local device key changes get to remote servers with correct prev_id
# Flakey # Flakey
Local device key changes appear in /keys/changes Local device key changes appear in /keys/changes
/context/ with lazy_load_members filter works
# we don't support groups # we don't support groups
Remove group category Remove group category
@ -32,9 +31,10 @@ Remove group role
# Flakey # Flakey
AS-ghosted users can use rooms themselves AS-ghosted users can use rooms themselves
/context/ with lazy_load_members filter works
AS-ghosted users can use rooms via AS AS-ghosted users can use rooms via AS
Events in rooms with AS-hosted room aliases are sent to AS server Events in rooms with AS-hosted room aliases are sent to AS server
Inviting an AS-hosted user asks the AS server
Accesing an AS-hosted room alias asks the AS server
# Flakey, need additional investigation # Flakey, need additional investigation
Messages that notify from another user increment notification_count Messages that notify from another user increment notification_count

View File

@ -515,7 +515,6 @@ AS can create a user with inhibit_login
AS can set avatar for ghosted users AS can set avatar for ghosted users
AS can set displayname for ghosted users AS can set displayname for ghosted users
Ghost user must register before joining room Ghost user must register before joining room
Inviting an AS-hosted user asks the AS server
Can generate a openid access_token that can be exchanged for information about a user Can generate a openid access_token that can be exchanged for information about a user
Invalid openid access tokens are rejected Invalid openid access tokens are rejected
Requests to userinfo without access tokens are rejected Requests to userinfo without access tokens are rejected
@ -661,6 +660,5 @@ Multiple calls to /sync should not cause 500 errors
Canonical alias can be set Canonical alias can be set
Canonical alias can include alt_aliases Canonical alias can include alt_aliases
Can delete canonical alias Can delete canonical alias
Multiple calls to /sync should not cause 500 errors
AS can make room aliases AS can make room aliases
Accesing an AS-hosted room alias asks the AS server /context/ with lazy_load_members filter works