Skip to content

Request size issue fix#303

Merged
yilmaztayfun merged 1 commit into
masterfrom
302-request-size
Jan 13, 2026
Merged

Request size issue fix#303
yilmaztayfun merged 1 commit into
masterfrom
302-request-size

Conversation

@tsimsekburgan
Copy link
Copy Markdown
Contributor

@tsimsekburgan tsimsekburgan commented Jan 13, 2026

Summary by Sourcery

Bug Fixes:

  • Adjust HTTP client and handler size limits to prevent failures when handling large request and response payloads.

Summary by CodeRabbit

  • Chores
    • Increased HTTP client buffering and header limits to accommodate larger payloads in requests and responses.

✏️ Tip: You can customize this high-level summary in your review settings.

@tsimsekburgan tsimsekburgan requested review from a team and mokoker January 13, 2026 12:08
@tsimsekburgan tsimsekburgan linked an issue Jan 13, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jan 13, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts HTTP client configuration for VNext API services to support larger request and response sizes by increasing buffering and header limits on both configured clients.

Class diagram for updated RemoteServiceExtensions HTTP client setup

classDiagram
    class RemoteServiceExtensions {
        +AddVNextApiServices IServiceCollection AddVNextApiServices(IServiceCollection services, VNextOptions options)
    }

    class HttpClient {
        +int MaxResponseContentBufferSize
        +HttpRequestHeaders DefaultRequestHeaders
    }

    class HttpClientHandler {
        +DecompressionMethods AutomaticDecompression
        +int MaxResponseHeadersLength
        +long MaxRequestContentBufferSize
    }

    class IServiceCollection
    class VNextOptions

    RemoteServiceExtensions ..> IServiceCollection : extends
    RemoteServiceExtensions ..> VNextOptions : configures
    RemoteServiceExtensions ..> HttpClient : configures
    RemoteServiceExtensions ..> HttpClientHandler : configures

    HttpClient o-- HttpClientHandler : uses as primary handler
Loading

File-Level Changes

Change Details Files
Increase HTTP client buffer and header size limits to handle larger payloads for VNext API calls.
  • Set MaxResponseContentBufferSize on HttpClient instances to int.MaxValue to allow buffering large responses.
  • Extend HttpClientHandler.AutomaticDecompression configuration to also set MaxResponseHeadersLength to 1MB.
  • Set HttpClientHandler.MaxRequestContentBufferSize to int.MaxValue to permit very large buffered request bodies on outgoing calls.
  • Apply the same HTTP client and handler configuration updates to both VNext API service registrations to keep them consistent.
src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#302 Update the WorkflowApiBaseServiceCollectionExtensions.AddWorkflowHttpClient() configuration used by HttpTaskInvoker (WorkflowHttpClient and WorkflowHttpClient.NoSslValidation) to increase limits: HttpClient.MaxResponseContentBufferSize, HttpClientHandler.MaxRequestContentBufferSize, and HttpClientHandler.MaxResponseHeadersLength. The PR only changes RemoteServiceExtensions.AddVNextApiServices in RemoteServiceExtensions.cs, adding the increased buffer and header limits there. It does not modify WorkflowApiBaseServiceCollectionExtensions.AddWorkflowHttpClient() or the WorkflowHttpClient / WorkflowHttpClient.NoSslValidation clients referenced in the issue.
#302 Ensure HTTP task execution via HttpTaskInvoker and HttpTaskBinding can handle large request bodies without errors by applying the increased limits to the HTTP clients they use. Because the PR does not change the configuration of the HTTP clients actually used by HttpTaskInvoker (WorkflowHttpClient and WorkflowHttpClient.NoSslValidation), the large request handling problem for HTTP task execution remains unresolved. The changes are limited to remote API service clients defined in RemoteServiceExtensions.cs.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 13, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'review'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

This PR modifies HTTP client configurations in the remote service extensions to increase buffering and header limits for request and response handling. It sets MaxResponseContentBufferSize to int.MaxValue in both API service setups, enables MaxResponseHeadersLength to 1 MB, and MaxRequestContentBufferSize to int.MaxValue. A trailing comma is also added after AutomaticDecompression for consistency.

Changes

Cohort / File(s) Change Summary
HTTP Client Buffer & Header Configuration
src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs
Increases HTTP client buffering limits: MaxResponseContentBufferSize set to int.MaxValue in both AddVNextApiServices setups, MaxResponseHeadersLength enabled to 1 MB, and MaxRequestContentBufferSize set to int.MaxValue in HttpClientHandler. Minor formatting: trailing comma added after AutomaticDecompression assignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With buffers expanded to limits so vast,
The HTTP pipes flow unsurpassed!
Headers and responses now soar without bounds,
This rabbit rejoices at these config sounds! 📡✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Request size issue fix' directly relates to the main change: increasing HTTP buffer and header size limits to resolve request size constraints.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 302-request-size

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @tsimsekburgan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses potential issues with large data transfers by significantly increasing the buffer and header size limits for HTTP client configurations. This ensures that the application can handle requests and responses with substantial content and header sizes without encountering truncation or errors, thereby improving the robustness of remote service interactions.

Highlights

  • Increased Buffer Sizes: The MaxResponseContentBufferSize for the HttpClient and MaxRequestContentBufferSize for the HttpClientHandler have both been set to int.MaxValue to accommodate very large request and response bodies.
  • Extended Response Header Limit: The MaxResponseHeadersLength in the HttpClientHandler has been increased to 1MB, up from the default 64KB, to prevent issues with large response headers.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jan 13, 2026

Here's the code health analysis summary for commits 6bd418c..d468ed2. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • Using int.MaxValue for MaxResponseContentBufferSize and MaxRequestContentBufferSize can create significant memory pressure or DOS risk; consider setting these to a justified upper bound or making them configurable instead of effectively unbounded.
  • The comment for MaxRequestContentBufferSize says the default is 2GB while the code sets it to int.MaxValue (~2GB as well); double-check whether this change actually addresses the issue or if the comment/value should be adjusted for clarity.
  • The new handler and client configuration is duplicated in both AddVNextApiServices registrations; consider extracting the common configuration into a shared helper to avoid divergence between the two clients.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Using `int.MaxValue` for `MaxResponseContentBufferSize` and `MaxRequestContentBufferSize` can create significant memory pressure or DOS risk; consider setting these to a justified upper bound or making them configurable instead of effectively unbounded.
- The comment for `MaxRequestContentBufferSize` says the default is 2GB while the code sets it to `int.MaxValue` (~2GB as well); double-check whether this change actually addresses the issue or if the comment/value should be adjusted for clarity.
- The new handler and client configuration is duplicated in both `AddVNextApiServices` registrations; consider extracting the common configuration into a shared helper to avoid divergence between the two clients.

## Individual Comments

### Comment 1
<location> `src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs:61-62` </location>
<code_context>
                     client.DefaultRequestHeaders.Add(clientOptions.InternalOperationHeader, "true");
                 }
+                
+                // Increase buffer size limits to handle large responses
+                client.MaxResponseContentBufferSize = int.MaxValue;
             })
             .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler()
</code_context>

<issue_to_address>
**issue:** Setting MaxResponseContentBufferSize to int.MaxValue is likely a no-op and may be misleading.

On current .NET versions `HttpClient.MaxResponseContentBufferSize` already defaults to `int.MaxValue`, so this line likely has no effect while the comment implies a behavioral change. Consider removing the comment (and possibly the assignment), or binding this value to configuration so any change is intentional and maintainable.
</issue_to_address>

### Comment 2
<location> `src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs:69-70` </location>
<code_context>
+                AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
+                // Increase response headers length limit (default is 64KB)
+                MaxResponseHeadersLength = 1024 * 1024, // 1MB
+                // Increase request content buffer size limit (default is 2GB)
+                MaxRequestContentBufferSize = int.MaxValue
             })
             .AddPolicyHandler(GetTimeoutPolicy(options))
</code_context>

<issue_to_address>
**issue:** MaxRequestContentBufferSize assignment and comment seem inconsistent and potentially ineffective.

Because `int.MaxValue` is roughly 2GB, this likely doesn’t change the default behavior despite the comment suggesting an increase. On newer .NET versions this property may also be deprecated/ignored. Consider removing it if redundant, or set it to a clearly justified, configurable limit instead of `int.MaxValue`.
</issue_to_address>

### Comment 3
<location> `src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs:67-68` </location>
<code_context>
             {
-                AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate
+                AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
+                // Increase response headers length limit (default is 64KB)
+                MaxResponseHeadersLength = 1024 * 1024, // 1MB
+                // Increase request content buffer size limit (default is 2GB)
+                MaxRequestContentBufferSize = int.MaxValue
</code_context>

<issue_to_address>
**🚨 issue (security):** MaxResponseHeadersLength unit mismatch makes the effective limit far larger than intended.

`MaxResponseHeadersLength` is in kilobytes, so `1024 * 1024` sets the limit to ~1GB, not 1MB, which significantly increases memory exposure and DoS risk. If you intend a 1MB limit, use `MaxResponseHeadersLength = 1024`, and consider using the smallest value that still covers your known scenarios.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +61 to +62
// Increase buffer size limits to handle large responses
client.MaxResponseContentBufferSize = int.MaxValue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: Setting MaxResponseContentBufferSize to int.MaxValue is likely a no-op and may be misleading.

On current .NET versions HttpClient.MaxResponseContentBufferSize already defaults to int.MaxValue, so this line likely has no effect while the comment implies a behavioral change. Consider removing the comment (and possibly the assignment), or binding this value to configuration so any change is intentional and maintainable.

Comment on lines +69 to +70
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: MaxRequestContentBufferSize assignment and comment seem inconsistent and potentially ineffective.

Because int.MaxValue is roughly 2GB, this likely doesn’t change the default behavior despite the comment suggesting an increase. On newer .NET versions this property may also be deprecated/ignored. Consider removing it if redundant, or set it to a clearly justified, configurable limit instead of int.MaxValue.

Comment on lines +67 to +68
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024 * 1024, // 1MB
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 issue (security): MaxResponseHeadersLength unit mismatch makes the effective limit far larger than intended.

MaxResponseHeadersLength is in kilobytes, so 1024 * 1024 sets the limit to ~1GB, not 1MB, which significantly increases memory exposure and DoS risk. If you intend a 1MB limit, use MaxResponseHeadersLength = 1024, and consider using the smallest value that still covers your known scenarios.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to resolve issues with large request sizes by adjusting HttpClient settings. While the increase of MaxResponseHeadersLength is a valid change, the modifications to MaxResponseContentBufferSize and MaxRequestContentBufferSize are problematic. Both are set to their default values, rendering the changes ineffective. Furthermore, MaxRequestContentBufferSize is an obsolete property. Relying on large in-memory buffers for requests and responses is a significant performance and stability risk, potentially leading to OutOfMemoryException. I have provided comments to remove the ineffective code. Additionally, there is significant code duplication in the HttpClient setup that should be refactored to improve maintainability.

Comment on lines +69 to +70
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The MaxRequestContentBufferSize property is obsolete and should be removed. Furthermore, it's being set to its default value (int.MaxValue), so this change is ineffective. Relying on buffering large requests is risky; consider using StreamContent for large uploads to avoid high memory usage.

Comment on lines +102 to +103
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This is a duplicate of the change on lines 69-70. The MaxRequestContentBufferSize property is obsolete and is being set to its default value, making the change ineffective. This should be removed.

Comment on lines +61 to +62
// Increase buffer size limits to handle large responses
client.MaxResponseContentBufferSize = int.MaxValue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Setting MaxResponseContentBufferSize to int.MaxValue is redundant as this is already the default value. While this change has no effect, it's important to note that relying on buffering for large responses can lead to high memory consumption and potential OutOfMemoryException. A more robust approach for large payloads is to stream the response content.

Comment on lines +94 to +95
// Increase buffer size limits to handle large responses
client.MaxResponseContentBufferSize = int.MaxValue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This is a duplicate of the change on lines 61-62. Setting MaxResponseContentBufferSize to int.MaxValue is redundant as this is the default value. Please consider the performance implications of buffering large responses in memory.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
@src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs:
- Around line 99-103: The MaxResponseHeadersLength value is using bytes (1024 *
1024) but the property expects kilobytes, so in the RemoteServiceExtensions
configuration replace the current expression (shown with
MaxResponseHeadersLength) with 1024 to represent 1MB and update the inline
comment accordingly; keep AutomaticDecompression and MaxRequestContentBufferSize
as-is and ensure the comment notes the unit is kilobytes.
- Around line 66-70: The MaxResponseHeadersLength is expressed in kilobytes, so
replace the incorrect value (currently 1024 * 1024) with 1024 to enforce a ~1MB
header limit by setting MaxResponseHeadersLength = 1024; also remove the
MaxRequestContentBufferSize setter (MaxRequestContentBufferSize) because it is
ignored on .NET Core/5+ (including net9.0) so delete that line rather than
relying on a no-op, and leave the AutomaticDecompression line unchanged.
🧹 Nitpick comments (2)
src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs (2)

60-62: Consider making buffer size limits configurable and document memory implications.

Setting MaxResponseContentBufferSize to int.MaxValue (~2GB) could cause significant memory pressure if multiple concurrent requests receive large responses. Consider:

  1. Adding configurable buffer size options to RemoteOptions instead of hardcoding int.MaxValue
  2. Documenting the expected response sizes that necessitated this change
♻️ Suggested approach: Add configurable options

Add to RemoteOptions:

public long MaxResponseContentBufferSize { get; set; } = 100 * 1024 * 1024; // 100MB default

Then use it in configuration:

-                client.MaxResponseContentBufferSize = int.MaxValue;
+                client.MaxResponseContentBufferSize = clientOptions.MaxResponseContentBufferSize;

93-95: Duplicated configuration - consider extracting to a shared helper.

This configuration block is identical to lines 60-62. Extracting HTTP client configuration to a helper method would reduce duplication and ensure both clients stay in sync.

♻️ Suggested extraction
private static void ConfigureHttpClient(HttpClient client, IRuntimeInfoProvider runtimeInfoProvider, RemoteOptions clientOptions)
{
    client.Timeout = TimeSpan.FromSeconds(clientOptions.TimeoutSeconds);
    client.DefaultRequestHeaders.Add("Accept", "application/json");
    client.DefaultRequestHeaders.Add("User-Agent",
        $"vnext-runtime/{runtimeInfoProvider.Version} ({runtimeInfoProvider.Domain})");

    if (clientOptions.EnableCircuitBreakerBypass)
    {
        client.DefaultRequestHeaders.Add(clientOptions.InternalOperationHeader, "true");
    }
    
    client.MaxResponseContentBufferSize = int.MaxValue; // or clientOptions.MaxResponseContentBufferSize
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bd418c and d468ed2.

📒 Files selected for processing (1)
  • src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs

📄 CodeRabbit inference engine (.cursor/rules/vnext.mdc)

**/*.cs: Write concise, idiomatic C# code with accurate examples
Follow Aether Framework's recommended folder and module structure (*.Application, *.Domain, *.Infrastructure, *.HttpApi)
Use object-oriented and functional programming patterns as appropriate
Prefer LINQ and lambda expressions for collection operations
Use descriptive variable and method names (e.g., IsUserSignedIn, CalculateTotal)
Follow Microsoft's modular development approach with extension structure to separate concerns between layers (Application, Domain, Infrastructure, etc.)
Organize extensions following the namespace of the class or structure where the extension will be written, generally in BBT.Workflow.Domain project to minimize 'using' statements
Follow Clean Architecture and SOLID principles
Apply Domain-Driven Design patterns: Aggregates, Entities, ValueObjects, Repositories, Domain Events
All cross-cutting concerns such as Clock, GuidGenerator, Mapper, Tracing, Logging, Metrics MUST use Aether SDK
Workflow, orchestration, task handling and runtime logic MUST follow vNext architectural conventions
Always use async/await
Use Dependency Injection everywhere
Avoid leaking EF entities
Apply Result Pattern
Use PascalCase for class names, method names, and public members
Use camelCase for local variables and private fields
Use UPPERCASE for constants
Prefix interface names with 'I' (e.g., IUserService)
Use C# 10+ features when appropriate (e.g., record types, pattern matching, null-coalescing assignment)
Leverage built-in ASP.NET Core features and middleware, as well as Aether's modules and features
Use Entity Framework Core effectively for database operations, integrating with Aether's AetherDbContext and repository abstractions
Follow the C# Coding Conventions from Microsoft documentation
Use C#'s expressive syntax (e.g., null-conditional operators, string interpolation)
Use 'var' for implicit typing when the type is obvious
Use exceptions for exceptional cases, not for control flow
Implemen...

Files:

  • src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Sourcery review
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build and analyze

Comment on lines +66 to +70
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024 * 1024, // 1MB
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

HttpClientHandler.MaxResponseHeadersLength unit documentation .NET

💡 Result:

The HttpClientHandler.MaxResponseHeadersLength value is measured in kilobytes (KB). The .NET docs note the default maximum is 64 KB and warn that the property is in kilobytes (not bytes). [1][2]

Sources:

  • Microsoft Learn: CA2262 (explains the property is measured in kilobytes; default 64 KB). [1]
  • .NET HttpClient documentation (context for HttpClient/handlers). [2]

🌐 Web query:

HttpClientHandler.MaxRequestContentBufferSize default value .NET

💡 Result:

Short answer: On .NET Core (and UWP) HttpClientHandler.MaxRequestContentBufferSize is not supported — the getter returns 0 and the setter is ignored. On older .NET Framework the property existed for buffering behavior. (gist.github.com)

Citations:


🏁 Script executed:

find . -name "*.csproj" -o -name "*.sln" | head -20

Repository: burgan-tech/vnext

Length of output: 1326


🏁 Script executed:

fd -e csproj | grep -i "Infrastructure\|Workflow" | head -10

Repository: burgan-tech/vnext

Length of output: 784


🏁 Script executed:

cat src/BBT.Workflow.Infrastructure/BBT.Workflow.Infrastructure.csproj

Repository: burgan-tech/vnext

Length of output: 1454


🏁 Script executed:

cat -n src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs | sed -n '50,80p'

Repository: burgan-tech/vnext

Length of output: 2044


Critical: MaxResponseHeadersLength unit is in kilobytes, not bytes.

MaxResponseHeadersLength is measured in kilobytes, not bytes. Setting 1024 * 1024 actually configures ~1GB (1,048,576 KB), not 1MB as the comment claims.

For 1MB response headers limit, use 1024:

🐛 Proposed fix
             AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
-            // Increase response headers length limit (default is 64KB)
-            MaxResponseHeadersLength = 1024 * 1024, // 1MB
+            // Increase response headers length limit (default is 64KB)
+            MaxResponseHeadersLength = 1024, // 1MB (unit is KB)
             // Increase request content buffer size limit (default is 2GB)
             MaxRequestContentBufferSize = int.MaxValue

Additionally, MaxRequestContentBufferSize is not supported on .NET Core/5+ (including net9.0 used here)—the setter is ignored at runtime. Remove this line unless documenting intent for a future migration.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024 * 1024, // 1MB
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024, // 1MB (unit is KB)
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
🤖 Prompt for AI Agents
In @src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs
around lines 66 - 70, The MaxResponseHeadersLength is expressed in kilobytes, so
replace the incorrect value (currently 1024 * 1024) with 1024 to enforce a ~1MB
header limit by setting MaxResponseHeadersLength = 1024; also remove the
MaxRequestContentBufferSize setter (MaxRequestContentBufferSize) because it is
ignored on .NET Core/5+ (including net9.0) so delete that line rather than
relying on a no-op, and leave the AutomaticDecompression line unchanged.

Comment on lines +99 to +103
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024 * 1024, // 1MB
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Same MaxResponseHeadersLength unit issue as above.

Apply the same fix here - the unit is kilobytes, so use 1024 for 1MB:

🐛 Proposed fix
             AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
-            // Increase response headers length limit (default is 64KB)
-            MaxResponseHeadersLength = 1024 * 1024, // 1MB
+            // Increase response headers length limit (default is 64KB)
+            MaxResponseHeadersLength = 1024, // 1MB (unit is KB)
             // Increase request content buffer size limit (default is 2GB)
             MaxRequestContentBufferSize = int.MaxValue
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024 * 1024, // 1MB
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
// Increase response headers length limit (default is 64KB)
MaxResponseHeadersLength = 1024, // 1MB (unit is KB)
// Increase request content buffer size limit (default is 2GB)
MaxRequestContentBufferSize = int.MaxValue
🤖 Prompt for AI Agents
In @src/BBT.Workflow.Infrastructure/Remote/Extensions/RemoteServiceExtensions.cs
around lines 99 - 103, The MaxResponseHeadersLength value is using bytes (1024 *
1024) but the property expects kilobytes, so in the RemoteServiceExtensions
configuration replace the current expression (shown with
MaxResponseHeadersLength) with 1024 to represent 1MB and update the inline
comment accordingly; keep AutomaticDecompression and MaxRequestContentBufferSize
as-is and ensure the comment notes the unit is kilobytes.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
100.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@yilmaztayfun yilmaztayfun merged commit bef5ed6 into master Jan 13, 2026
7 of 8 checks passed
@yilmaztayfun yilmaztayfun added the bug Something isn't working label Jan 13, 2026
@github-project-automation github-project-automation Bot moved this to Test in vNext Jan 13, 2026
@yilmaztayfun yilmaztayfun added this to the v0.0.31 milestone Jan 13, 2026
@yilmaztayfun yilmaztayfun moved this from Test to In Production / Done in vNext Jan 13, 2026
@yilmaztayfun yilmaztayfun removed this from vNext Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request Size

3 participants