Skip to content

RequestConfiguration of generated requests not respected during request execution #8511

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

Open
4lexKislitsyn opened this issue May 6, 2025 · 4 comments
Labels
8.x Relates to a 8.x client version 9.x Relates to a 9.x client version Area: Client Category: Bug

Comments

@4lexKislitsyn
Copy link

It appears that the RequestConfiguration property of PlainRequest is not being used during the execution of the request.

For example, it is possible to initialize a request (e.g., SearchTemplateRequest) with a custom request configuration using PlainRequest.RequestConfiguration. However, during the actual execution within the client, only Request.RequestConfig is used — which seems to be independent of the previously configured RequestConfiguration.
Example:

var requestDescriptor = new SearchTemplateRequestDescriptor()
    .RequestConfiguration(x => x.DisablePing());
var response = await elasticClient.SearchTemplateAsync<object>(requestDescriptor, cancellationToken);

When stepping through the execution, it becomes clear that only RequestConfig is referenced, and the configuration provided via the descriptor (e.g., DisablePing) is lost.

This seems like an oversight. There should likely be an initialization or transfer of the RequestConfiguration data to RequestConfig during request setup to preserve the intended behavior.

@flobernd
Copy link
Member

flobernd commented May 6, 2025

Hi @4lexKislitsyn, what version of the client package are you using?

@4lexKislitsyn
Copy link
Author

Hi. I found this on version 9.0.1 but this issue seems to be present on version 8 as well.

@flobernd flobernd added 8.x Relates to a 8.x client version Category: Bug 9.x Relates to a 9.x client version labels May 6, 2025
@flobernd
Copy link
Member

flobernd commented May 6, 2025

Thanks for reporting! I'll have a look 🙂

@4lexKislitsyn
Copy link
Author

If it helps you can look into this methods: SendRequestWithProductCheckCore, SendRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version 9.x Relates to a 9.x client version Area: Client Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants