IEvangelist / azure-cosmos-dotnet-repository

Wraps the .NET SDK for Azure Cosmos DB abstracting away the complexity, exposing a simple CRUD-based repository pattern
https://ievangelist.github.io/azure-cosmos-dotnet-repository
MIT License
300 stars 89 forks source link

Add support for QueryRequestOption property ResponseContinuationTokenLimitInKb #432

Open victormarante opened 5 months ago

victormarante commented 5 months ago

Is your feature request related to a problem? Please describe. Continuation tokens from Cosmos V3 SDK sometimes become too large for servers/browser agents too handle (either resulting in errors when receiving such a large item, or getting 414 URI too long). This issue happens when continuation token is part of route, but will also be an issue since it can be too large even for headers.

Describe the solution you'd like QueryRequestOptions from the Cosmos SDK supports setting a continuation token limit. This would be helpful if it was exposed from this NuGet so we can control the size of the token in cases there it becomes to large

IEvangelist commented 5 months ago

Hi there @victormarante - I like this proposal. Would you be interested in helping out, by providing a PR? I'm imagining that we could add an overload that exposes this to the various APIs where it's needed.

victormarante commented 5 months ago

Hi! I can surely do so. I will look into your contribution guidelines and create a PR once I am done.

victormarante commented 5 months ago

Noticed you don't have a contribution guideline, but I will do my best. A question on what direction you are thinking:

  1. As you suggested, go through all the API's and add an overload for the API's that may return a ContinuationToken, or
  2. Allow users to send in either QueryRequestOptions or sub-set of the options to all API's that utilizes it (which seems to be DefaultRepository.Paging.cs and DefaultRepository.Specs.cs

Not sure which approach you fancy, but the easier on (point 1), might be what I begin with and we'll go from there.

IEvangelist commented 5 months ago

Yeah, I think the overload approach is the most straightforward (option 1). That seems similar to option 2, no? Wouldn't the overload accept a QueryRequestOptions?

IEvangelist commented 5 months ago

@all-contributors please add @victormarante for issue and code

allcontributors[bot] commented 5 months ago

@IEvangelist

I've put up a pull request to add @victormarante! :tada: