SoapCore icon indicating copy to clipboard operation
SoapCore copied to clipboard

fix: [DI] Resolve IMessageInspector2 Using Scope Resolver

Open ankitkmrpatel opened this issue 1 year ago • 7 comments

----IMessageInsector2 is being Added as Scope Service, However, it is being resolve as Sington Service

ankitkmrpatel avatar Dec 13 '23 11:12 ankitkmrpatel

Could you please update your branch from the latest "develop"? Needed to fix some things to make CI work

andersjonsson avatar Jan 02 '24 08:01 andersjonsson

Hi @andersjonsson

The CI/CD test for the pull request is encountering a fetch error. Would you mind re-running the test to resolve this issue?

Here is the specific fetch command that is causing the issue: fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz

ankitkmrpatel avatar Jan 11 '24 06:01 ankitkmrpatel

Please update your branch with the latest "develop". I've fixed the issues there

andersjonsson avatar Jan 11 '24 07:01 andersjonsson

Thanks, I have pulled the latest changes from the 'develop' branch.

Hope this works!

ankitkmrpatel avatar Jan 12 '24 09:01 ankitkmrpatel

I think you pulled the changes from your own develop-branch, including the code for custom serializers.

andersjonsson avatar Jan 19 '24 13:01 andersjonsson

When I look at the code for resolving IMessageInspector2 I'm not sure that the changes make sense.

Since the serviceProvider is passed in to each invoke it should be resolved as registered. I suppose you have an indication that this isn't the case. What is the issue you are running into?

andersjonsson avatar Jan 19 '24 13:01 andersjonsson

Hi @andersjonsson ,

Referring to commit [Git Hub Commit#58afbb9]](https://github.com/DigDes/SoapCore/pull/982/commits/58afbb9b5d7582da6e4c189859c77f7822a5d23e), The IMessageInspector2 has been resolved as a scoped dependency.

As you mentioned, serviceProvider is passed into each invoke it should be resolved as registered. However, It is noted that the IMessageInspector2 has been registered as scoped but resolved as singleton.

Have changed from singleton di resolve to scope di resolve in src/SoapCore/SoapEndpointMiddleware.cs.

ankitkmrpatel avatar Feb 26 '24 07:02 ankitkmrpatel

Hi @andersjonsson

I hope you're doing well.

I wanted to check in and see if you've had a chance to look into the issue I sent over earlier. If you need any additional information, please let me know.

Regards; Ankit

ankitkmrpatel avatar Jun 12 '24 10:06 ankitkmrpatel