Repository navigation
docs(core): correct the WaitBetterAsync comments and listed version - #125
Merged
Merged
Conversation
Three comments said WaitBetterAsync ignores the cancellation token without a timeout, which stopped being true in Plugin.BaseTypeExtensions 1.0.35; they now state the real difference, how a zero timeout is read. The dependency list in COPILOT_INSTRUCTIONS.md names version 1.0.35.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the documentation and comment updates.
No open issues 🎉
What changed in this PR
Updates comments and documentation after the Plugin.BaseTypeExtensions 1.0.35 upgrade in #123. No executable code or runtime behavior changes.
Changes:
- Replaces outdated cancellation-token claims with the zero-timeout distinction between
Task.WaitAsyncandWaitBetterAsync. - Explains the broadcaster’s reliance on immediate timeout when its remaining budget reaches zero.
- Updates the documented
Plugin.BaseTypeExtensionsversion to 1.0.35.
| File | Description |
|---|---|
Docs/COPILOT_INSTRUCTIONS.md |
Corrects the listed dependency version. |
Bluetooth.Core.Scanning/BaseBluetoothScanner.StartStop.cs |
Clarifies zero-timeout behavior in the stop-wait comment. |
Bluetooth.Core.Scanning/BaseBluetoothRemoteDevice.Connection.cs |
Corrects the comment explaining the use of Task.WaitAsync. |
Bluetooth.Core.Broadcasting/BaseBluetoothBroadcaster.StartStop.cs |
Clarifies zero-timeout behavior and its connection to RemainingTimeout. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Corrects three code comments that say
WaitBetterAsyncignores the cancellation token when there is no timeout, and thePlugin.BaseTypeExtensionsversion inDocs/COPILOT_INSTRUCTIONS.md. Comments and one doc line only; no code changes.Why
Since
Plugin.BaseTypeExtensions1.0.35 (#123),WaitBetterAsyncobserves the token with no timeout, so the comments are wrong. They sit onWaitForStopAsync(scanner and broadcaster) andWaitForAttemptAsync(remote device), which wait withTask.WaitAsync. The real difference fromWaitBetterAsyncis how a zero timeout is read, and the comments now say that.Change Type
refa)Affected Areas
Bluetooth.Maui)Behavior And Compatibility
Platform Notes
None.
Tests
Validation notes: comments and a doc line only.
Bluetooth.Core.ScanningandBluetooth.Core.Broadcastingbuild in Release with--no-incremental, 0 warnings and 0 errors (the new<see cref="RemainingTimeout" />resolves).Documentation
Logging / Diagnostics
Risks And Follow-ups
Risk level:
Known limitations or deferred follow-ups:
WaitBetterAsync: with a zero timeout and a task that has not finished,Task.WaitAsyncthrowsTimeoutExceptionwhileWaitBetterAsyncwaits for the task, and a negative timeout other thanTimeout.InfiniteTimeSpanthrowsArgumentOutOfRangeExceptioninTask.WaitAsyncbut means "no timeout" inWaitBetterAsync(checked against 1.0.35). The broadcaster passes zero on purpose throughRemainingTimeoutwhen the budget has run out, so swapping the helpers would turn that into an unbounded wait.WaitBetterAsync("no timeout"), a caller that joins an operation already running waits withTask.WaitAsync("time out now"). Picking one reading for both is a behavior change and is not part of this PR.Docs/COPILOT_INSTRUCTIONS.mdstill shows older numbers for the other packages (ByteArrays 1.0.30, ExceptionListeners 1.0.5, Microsoft.Extensions 10.0.3); the doc itself says to readDirectory.Packages.props.Checklist
type (scope): short imperativeand is <= 72 chars