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.

check_username_for_spam's documentation incorrectly claims that avatar_url and display_name are never None #12245

@squahtx

Description

@squahtx

Description

The Synapse documentation claims that the check_username_for_spam spam checker callback receives a userprofile that is a Dict[str, str]. In practice, there can be Nones in the userprofile dict, eg.

{
    avatar_url: None, 
    display_name: None, 
    user_id: '@[redacted]:matrix.org'
}

See https://sentry.matrix.org/sentry/synapse-matrixorg/issues/243697/ for examples of userprofiles with missing avatars and display names.

docs/modules/spam_checker_callbacks.md and CHECK_USERNAME_FOR_SPAM_CALLBACK could do with an update.

Metadata

Metadata

Assignees

Labels

T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions