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

Factory.Create no longer runs Configure on the Endpoint #569

Closed
Jmaharman opened this issue Jan 2, 2024 · 4 comments
Closed

Factory.Create no longer runs Configure on the Endpoint #569

Jmaharman opened this issue Jan 2, 2024 · 4 comments
Labels
bug Something isn't working fixed the bug has been squashed

Comments

@Jmaharman
Copy link

Jmaharman commented Jan 2, 2024

Firstly thank you for this excellent library, we started using it about a year ago and love it's simplicity and power.

We're currently updating from 5.2.1 to the latest and we noticed that Configure is no longer called on the Endpoint when using Factory.Create.

I've looked at the source code and it seems to have been introduced from the following commit:

dependency resolving support for endpoint Configure() method - 77d656e

image

the crux of it is that ImplementsConfigure and EndpointAttributes are no longer set. I was going to PR my change which gets it workin, seen below on lines 32 and 33, but I imagine that's now how you want to implement it.

image

Test added:

public class FactoryCreateTests
{
    [Fact]
    public async Task ConfigureIsExecuted()
    {
        var ep = Factory.Create<ConfigureEndpoint>();

        ep.Definition.Routes.Should().ContainSingle("configure/test");
    }
}
public class ConfigureEndpoint : Endpoint<Request, Response>
{

    public override void Configure()
    {
        Verbs(Http.GET);
        Routes("configure/test");
    }

    public override Task HandleAsync(Request r, CancellationToken ct)
    {
        return SendErrorsAsync();
    }
}
@dj-nitehawk dj-nitehawk added the bug Something isn't working label Jan 2, 2024
@dj-nitehawk
Copy link
Member

wow not sure how that went unnoticed 🤦‍♂️
fixed in 5.21.1.1-beta and thank you so much for hunting down the cause.
much appreciated!

@dj-nitehawk dj-nitehawk added the fixed the bug has been squashed label Jan 2, 2024
@Jmaharman
Copy link
Author

wow, thanks so much for the quick turn around. We're testing it now.

@dj-nitehawk
Copy link
Member

you're most welcome. it was fast because you found the exact cause :-)
a patch release v5.21.2 has been pushed to nuget.
should be live in a few minutes.

@Jmaharman
Copy link
Author

It worked perfectly by the way, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed the bug has been squashed
Development

No branches or pull requests

2 participants