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

Simplify construction of MeilisearchClient in DI #493

Merged

Conversation

ahmednfwela
Copy link
Collaborator

Pull Request

Related issue

Fixes part of #481, which is the inability to use .AddHttpMessageHandler<MeilisearchMessageHandler>()

What does this PR do?

  • Adds default constructor for MeilisearchMessageHandler
  • Refactor MeilisearchClient constructors to call one another, instead of redefining the logic in both.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@ahmednfwela ahmednfwela requested review from brunoocasali and alallema and removed request for brunoocasali October 18, 2023 13:38
Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

Hey @ahmednfwela how can I check if this change does the trick?! 😬

Is there a way to add tests or something? If not possible, let's merge anyway!

@ahmednfwela
Copy link
Collaborator Author

@brunoocasali The constructor change of MeilisearchClient is already covered by tests
and the MeilisearchMessageHandler constructor doesn't need tests, as long as it compiles.

@ahmednfwela
Copy link
Collaborator Author

We can add a new package to the repository to help with DI scenarios, that will be based on this comment #481 (comment).

@brunoocasali
Copy link
Member

brunoocasali commented Oct 24, 2023

I don't think it is needed unless you say so! You can merge this if you want!

@ahmednfwela
Copy link
Collaborator Author

bors merge

@meili-bors
Copy link
Contributor

meili-bors bot commented Oct 25, 2023

Build succeeded:

@meili-bors meili-bors bot merged commit d0193c4 into meilisearch:main Oct 25, 2023
4 checks passed
@ahmednfwela ahmednfwela deleted the simplify-meilisearch-construction branch October 25, 2023 00:34
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.

None yet

2 participants