Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

/joined_members incorrectly says the appservice wasn't in the room #7373

@Sorunome

Description

@Sorunome

Description

When trying to call /joined_members synapse incorrectly claims that the appservice wasn't in the room. While the appservice bot itself is indeed not in the room, the ghost set in the user_id query parameter is.

sorunome@sorunome-desktop ~ $ curl -H "Authorization: Bearer 0d1dcaae-26db-4810-b284-48df4223328e" "http://192.168.1.13:8008/_matrix/client/r0/rooms/%21KiNzXZsRUASeNmbTVD%3A192.168.1.13/joined_members?user_id=%40_botty_n%3D2cj1x3ls3e_42sq9ub%3A192.168.1.13"
{
    "joined": {
        "@_botty_n=2cj1x3ls3e_42sq9ub:192.168.1.13": {
            "avatar_url": "mxc://192.168.1.13/SFPimpzstdTNxFuIoxwClVRV",
            "display_name": "Fuchs Rolle!!!"
        },
        "@test:192.168.1.13": {
            "avatar_url": "mxc://192.168.1.13/YKbcxzDWAYgwrdegzQZmFMYX",
            "display_name": "test"
        }
    }
}
sorunome@sorunome-desktop ~ $ curl -X PUT -H "Authorization: Bearer 0d1dcaae-26db-4810-b284-48df4223328e" -H "Content-Type: application/json" -d '{"beep": "boop"}' "http://192.168.1.13:8008/_matrix/client/r0/rooms/%21KiNzXZsRUASeNmbTVD%3A192.168.1.13/state/de.sorunome.custom/%40_botty_n%3D2cj1x3ls3e_42sq9ub%3A192.168.1.13?user_id=%40_botty_n%3D2cj1x3ls3e_42sq9ub%3A192.168.1.13" 
{
    "event_id": "$nfrfZ-FtF1LLJZAPjfVYoSHplI0tkNeQ3GSCGi5wjig"
}
sorunome@sorunome-desktop ~ $ curl -H "Authorization: Bearer 0d1dcaae-26db-4810-b284-48df4223328e" "http://192.168.1.13:8008/_matrix/client/r0/rooms/%21KiNzXZsRUASeNmbTVD%3A192.168.1.13/joined_members?user_id=%40_botty_n%3D2cj1x3ls3e_42sq9ub%3A192.168.1.13"
{
    "errcode": "M_FORBIDDEN",
    "error": "Appservice not in room"
}

(The appservice token is only for a local install)

Steps to reproduce

  • start synapse
  • call /joined_members as an appservice ghost that the ghost is in --> it returns the results just fine
  • set a state event as said ghost with the state_key being its mxid. This needs to actually create a new / modify the existing state, else the bug won't trigger
  • call again /joined_members, synapse now claims the appservice wasn't in the room until a restart occurs

Version information

  • Version:
sorunome@sorunome-desktop ~ $ curl http://localhost:8008/_synapse/admin/v1/server_version
{
    "python_version": "3.8.2",
    "server_version": "1.12.4 (b=master,204664d1a)"
}
  • Install method:
    git clone

  • Platform:
    archlinux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions