Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor get_profile: do not return missing fields. #18063

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

clokep
Copy link
Contributor

@clokep clokep commented Dec 31, 2024

Refactor get_profile to avoid returning "empty" (None / null) fields. Currently this is not very important, but will be more useful once #17488 lands. It does update the servlet to use this now which has a minor change in behavior: additional fields served over federation will now be properly sent back to clients.

It also adds constants for avatar_url / displayname although I did not attempt to use it everywhere possible.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct
    (run the linters)

@clokep clokep marked this pull request as ready for review December 31, 2024 19:24
@clokep clokep requested a review from a team as a code owner December 31, 2024 19:24
@clokep
Copy link
Contributor Author

clokep commented Jan 1, 2025

Actually I think this is missing one change to the servlet which makes the changes a bit clearer of why we want them.

@anoadragon453
Copy link
Member

Actually I think this is missing one change to the servlet which makes the changes a bit clearer of why we want them.

@clokep Should we mark this as a draft until that's done?

@clokep
Copy link
Contributor Author

clokep commented Jan 2, 2025

Actually I think this is missing one change to the servlet which makes the changes a bit clearer of why we want them.

@clokep Should we mark this as a draft until that's done?

Whatever works in your process. I won't have time to get to it today.

@clokep
Copy link
Contributor Author

clokep commented Jan 3, 2025

@anoadragon453 This should be ready to review now.

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice idea to use a constant to differentiate from custom ones. And thanks for splitting this out.

synapse/handlers/profile.py Outdated Show resolved Hide resolved
@anoadragon453 anoadragon453 merged commit 6306de8 into element-hq:develop Jan 3, 2025
38 checks passed
@clokep clokep deleted the get-prof-ref branch January 3, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants