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

avatar_url is null rather than "" in invite #7333

Closed
neilalexander opened this issue Apr 23, 2020 · 1 comment · Fixed by #7497
Closed

avatar_url is null rather than "" in invite #7333

neilalexander opened this issue Apr 23, 2020 · 1 comment · Fixed by #7497
Labels
A-Spec-Compliance places where synapse does not conform to the spec z-bug (Deprecated Label)

Comments

@neilalexander
Copy link

neilalexander commented Apr 23, 2020

Description

An incoming v2 invite event from Synapse seems to set avatar_url to nil rather than "", which doesn't match the spec's expectation of it being a string.

Steps to reproduce

  • invite a user to a room
  • observe request body, e.g.
{
  "event": {
    "auth_events": [
      "$uxl1r0IVu5dju5WaLyDWsiGkKu9VMpyLbTsXwVCSjg8",
      "$CDijC-qEh1F9wx2GaEDaVjZeZAotLyb9XECviqXYuQA",
      "$8u2LDvw2PQA1j7huGGlQ11_i1vYC_HLvPjyltQul1l0",
      "$r4MvBNTvC6aahOFhXUP2jHTAzLZDXYURLAipCNUD940",
      "$cmlp6_-XjUKXiKSsbnV0HSH9LXFw00r8Mu6eqG5RuWc"
    ],
    "content": {
      "avatar_url": "",
      "displayname": "neilalexander (Dendrite)",
      "membership": "invite"
    },
    "depth": 10,
    "hashes": {
      "sha256": "hl9idNvIrjXKVuUZwHdadEIsTk1hiul4Zqb5eJdrapk"
    },
    "origin": "synapse.neilalexander.dev",
    "origin_server_ts": 1587635800175,
    "prev_events": [
      "$8u2LDvw2PQA1j7huGGlQ11_i1vYC_HLvPjyltQul1l0"
    ],
    "prev_state": [
      
    ],
    "room_id": "!VRajJeEmcnrLJXqSoR:synapse.neilalexander.dev",
    "sender": "@neilalexander:synapse.neilalexander.dev",
    "signatures": {
      "synapse.neilalexander.dev": {
        "ed25519:a_MIwE": "B6IriXnW1afEYChG5/fSOl+nuUWDYg+IcITfx8vn0ZELyesuxxgDLjX0a5xVV0txd4cz9z829krkU95cSbUuBA"
      }
    },
    "state_key": "@neilalexander:dendrite.neilalexander.dev",
    "type": "m.room.member",
    "unsigned": {
      "age": 18,
      "invite_room_state": [
        {
          "content": {
            "join_rule": "invite"
          },
          "sender": "@neilalexander:synapse.neilalexander.dev",
          "state_key": "",
          "type": "m.room.join_rules"
        },
        {
          "content": {
            "name": "Test"
          },
          "sender": "@neilalexander:synapse.neilalexander.dev",
          "state_key": "",
          "type": "m.room.name"
        },
        {
          "content": {
            "avatar_url": null,
            "displayname": "neilalexander (Synapse)",
            "membership": "join"
          },
          "sender": "@neilalexander:synapse.neilalexander.dev",
          "state_key": "@neilalexander:synapse.neilalexander.dev",
          "type": "m.room.member"
        }
      ],
      "replaces_state": "$8u2LDvw2PQA1j7huGGlQ11_i1vYC_HLvPjyltQul1l0"
    }
  },
  "invite_room_state": [
    {
      "content": {
        "join_rule": "invite"
      },
      "sender": "@neilalexander:synapse.neilalexander.dev",
      "state_key": "",
      "type": "m.room.join_rules"
    },
    {
      "content": {
        "name": "Test"
      },
      "sender": "@neilalexander:synapse.neilalexander.dev",
      "state_key": "",
      "type": "m.room.name"
    },
    {
      "content": {
        "avatar_url": null,
        "displayname": "neilalexander (Synapse)",
        "membership": "join"
      },
      "sender": "@neilalexander:synapse.neilalexander.dev",
      "state_key": "@neilalexander:synapse.neilalexander.dev",
      "type": "m.room.member"
    }
  ],
  "room_version": "4"
}

Version information

  • Homeserver: synapse.neilalexander.dev

If not matrix.org:

  • Version: {"server_version": "1.11.0", "python_version": "3.7.6"}

  • Install method: Docker matrixdotorg/synapse image ID d64d49dfd131

  • Platform: Linux/VMware Photon OS 3.0 running Docker

@clokep clokep added z-bug (Deprecated Label) A-Spec-Compliance places where synapse does not conform to the spec labels Apr 23, 2020
richvdh pushed a commit that referenced this issue May 19, 2020
…g null (#7497)

Per https://github.com/matrix-org/matrix-doc/issues/1436#issuecomment-410089470 they should be omitted instead of returning null or "". They aren't marked as required in the spec.

Fixes #7333

Signed-off-by: Aaron Raimist <aaron@raim.ist>
@richvdh
Copy link
Member

richvdh commented May 19, 2020

fixed by #7497

@richvdh richvdh closed this as completed May 19, 2020
phil-flex pushed a commit to phil-flex/synapse that referenced this issue Jun 16, 2020
…g null (matrix-org#7497)

Per https://github.com/matrix-org/matrix-doc/issues/1436#issuecomment-410089470 they should be omitted instead of returning null or "". They aren't marked as required in the spec.

Fixes matrix-org#7333

Signed-off-by: Aaron Raimist <aaron@raim.ist>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec z-bug (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants