Skip to content

appservice/intent: allow setting avatar when profile field is missing - #563

Closed
PolynomialDivision wants to merge 1 commit into
mautrix:mainfrom
PolynomialDivision:fix/avatar-m-not-found
Closed

appservice/intent: allow setting avatar when profile field is missing#563
PolynomialDivision wants to merge 1 commit into
mautrix:mainfrom
PolynomialDivision:fix/avatar-m-not-found

Conversation

@PolynomialDivision

Copy link
Copy Markdown

Homeservers may return M_NOT_FOUND when avatar_url has not been set for a profile yet, for example Tuwunel. SetAvatarURL previously treated this valid response as a fatal error and returned before sending the new avatar.

Treat M_NOT_FOUND as an empty avatar and continue with the PUT request. All other errors remain fatal.

Checklist

Homeservers may return M_NOT_FOUND when avatar_url has not been set for
a profile yet, for example Tuwunel. SetAvatarURL previously treated this
valid response as a fatal error and returned before sending the new avatar.

Treat M_NOT_FOUND as an empty avatar and continue with the PUT request.
All other errors remain fatal.
jevolk added a commit to matrix-construct/tuwunel that referenced this pull request Sep 1, 2026
Since the spec folded these endpoints into the generic field route,
the only unset-field response is a 404 no other server sends and
clients treat as fatal (mautrix/go#563);
custom keys keep the MSC4133 404.

Signed-off-by: Jason Volk <jason@zemos.net>
jevolk added a commit to matrix-construct/tuwunel that referenced this pull request Sep 1, 2026
Since the spec folded these endpoints into the generic field route,
the only unset-field response is a 404 no other server sends and
clients treat as fatal (mautrix/go#563);
custom keys keep the MSC4133 404.

Signed-off-by: Jason Volk <jason@zemos.net>
@PolynomialDivision

Copy link
Copy Markdown
Author

@jevolk Thanks for adding the tuwunel fix. However, this PR should still be merged because your commit is just a workaround?

@tulir

tulir commented Sep 2, 2026

Copy link
Copy Markdown
Member

The spec might get changed instead to define that displayname/avatar_url return 200 even when unset, because that was the behavior in all servers pre-MSC4133: https://matrix.to/#/!0KNSXYXB_2xtEUkQ9MGBRy5oNIOfAKoq2uIqPZCJbI8/%24DILQ8eUyvHbDB9eXFNQ-jnDYN0XcH9LM4yf_5D8Be1s?via=maunium.net&via=matrix.org&via=element.io

@PolynomialDivision

Copy link
Copy Markdown
Author

Okay, so I will close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants