Skip to content

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Oct 3, 2025

No need to have version_string as an argument since it's always the same.

Assuming, we're happy with #19011, this PR makes sense. But we should leave the decision and context of having them be the same to that PR first.

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)

Keywords make it easier to search and positional arguments are easy
to mess up especially when there are multiple strings next to each
other.
version_string: A string to present for the Server header
max_request_body_size: TODO
context_factory: TODO
reactor: TODO
Copy link
Contributor Author

@MadLittleMods MadLittleMods Oct 3, 2025

Choose a reason for hiding this comment

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

These are future TODO's (not for this PR)


def __init__(
self,
*,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made these keyword only arguments to make it easier to search and confirm what server_version_string was used for.

Additionally, a good idea because positional arguments are easy to mess up especially when there are multiple strings next to each other.

self._instance_name = config.worker.instance_name

self.version_string = version_string
self.version_string = f"Synapse/{SYNAPSE_VERSION}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main change is consolidating everything to this assignment instead of this being passed in as an argument.

@MadLittleMods MadLittleMods marked this pull request as ready for review October 3, 2025 22:08
@MadLittleMods MadLittleMods requested a review from a team as a code owner October 3, 2025 22:08
@MadLittleMods MadLittleMods merged commit 7b88313 into develop Oct 7, 2025
76 of 78 checks passed
@MadLittleMods MadLittleMods deleted the madlittlemods/version-string-consolidation branch October 7, 2025 18:27
@MadLittleMods
Copy link
Contributor Author

Thanks for the review @anoadragon453 🦝

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