Uh oh!
There was an error while loading. Please reload this page.
Document Timeout property behavior for RestClientOptions and RestRequest - #2331
Conversation
Co-authored-by: alexeyzimarev <2821205+alexeyzimarev@users.noreply.github.com>
Deploying restsharp with |
| Latest commit: | f84bd32 |
| Status: | ✅ Deploy successful! |
| Preview URL: | https://465999c6.restsharp.pages.dev |
| Branch Preview URL: | https://copilot-add-documentation-fo.restsharp.pages.dev |
Co-authored-by: alexeyzimarev <2821205+alexeyzimarev@users.noreply.github.com>
Co-authored-by: alexeyzimarev <2821205+alexeyzimarev@users.noreply.github.com>
Test Results 42 files 42 suites 17m 26s ⏱️ Results for commit f84bd32. |
Uh oh!
There was an error while loading. Please reload this page.
Review Summary by QodoDocument Timeout property behavior and configuration guide WalkthroughsDescription• Enhanced XML documentation for Timeout properties in RestClientOptions and RestRequest • Added comprehensive timeout behavior guide in configuration documentation • Documented timeout resolution priority and supported timeout values • Replaced obsolete MaxTimeout reference with Timeout and fixed typo Diagramflowchart LR
A["Timeout Configuration"] --> B["XML Documentation"]
A --> C["User Guide"]
B --> B1["RestClientOptions.Timeout"]
B --> B2["RestRequest.Timeout"]
C --> C1["Timeout Resolution Priority"]
C --> C2["Behavior Reference Table"]
C --> C3["Code Examples"]
C1 --> C1a["Request Level → Client Level → Default 100s"]
C2 --> C2a["null, Positive, Infinite, Zero, Invalid"]
File Changes1. src/RestSharp/Options/RestClientOptions.cs |
Code Review by Qodo
1. MaxTimeout 0/-1 undocumented |
| :::note Migration from MaxTimeout | ||
| In older versions of RestSharp, the `MaxTimeout` property (measured in milliseconds) was used. This has been replaced by the `Timeout` property, which uses `TimeSpan` for more intuitive and type-safe timeout configuration. | ||
| ::: |
There was a problem hiding this comment.
1. maxtimeout 0/-1 undocumented 📎 Requirement gap✓ Correctness
The new timeout documentation mentions migration from MaxTimeout but does not document MaxTimeout behavior for boundary values 0 and -1 as required. This leaves users without the requested legacy guidance when migrating to Timeout.
Agent Prompt
## Issue description
The documentation adds a migration note for `MaxTimeout` but does not document what `MaxTimeout = 0` and `MaxTimeout = -1` do, which is explicitly required.
## Issue Context
Compliance requires explaining legacy `MaxTimeout` boundary behaviors (0 and -1) and clearly relating them to the newer `Timeout` (`TimeSpan?`) option.
## Fix Focus Areas
- docs/docs/advanced/configuration.md[232-258]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| :::note Migration from MaxTimeout | ||
| In older versions of RestSharp, the `MaxTimeout` property (measured in milliseconds) was used. This has been replaced by the `Timeout` property, which uses `TimeSpan` for more intuitive and type-safe timeout configuration. | ||
| ::: |
There was a problem hiding this comment.
2. Maxtimeout still documented 🐞 Bug✓ Correctness
The PR updates configuration docs to say MaxTimeout was replaced by Timeout, but other non-versioned docs still show MaxTimeout usage and lists. Users following those examples will hit compilation errors and conflicting guidance.
Agent Prompt
### Issue description
Current (non-versioned) docs still reference `MaxTimeout` even though the PR documents that `MaxTimeout` has been replaced by `Timeout`. This leaves conflicting guidance and non-compilable examples.
### Issue Context
The PR improves timeout documentation in `advanced/configuration.md`, but other current docs pages need to match the same API surface.
### Fix Focus Areas
- docs/docs/usage/client.md[24-52]
- docs/docs/advanced/configuration.md[236-238]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Description
Users were unclear about how RestSharp handles
Timeoutvalues of 0, -1, and other negative values. The documentation was minimal and still referenced the obsoleteMaxTimeoutproperty.Purpose
This pull request is a:
Changes
Source Code (XML Documentation)
Enhanced
RestClientOptions.TimeoutandRestRequest.Timeoutwith detailed remarks explaining:Timeout.InfiniteTimeSpanorTimeSpan.FromMilliseconds(-1)TimeSpan.ZeroArgumentOutOfRangeExceptionUser Documentation
configuration.md updates:
MaxTimeoutreference withTimeoutTImeout→TimeoutTimeout Behavior Reference
nullTimeSpanTimeout.InfiniteTimeSpan/TimeSpan.FromMilliseconds(-1)TimeSpan.ZeroArgumentOutOfRangeExceptionExample
Checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.