Skip to content

Fix CS1998 async warning in PromptForMessagingEndpointAsync#443

Merged
gwharris7 merged 1 commit into
mainfrom
gwharris7/fix-cs1998-async-warning
Jun 4, 2026
Merged

Fix CS1998 async warning in PromptForMessagingEndpointAsync#443
gwharris7 merged 1 commit into
mainfrom
gwharris7/fix-cs1998-async-warning

Conversation

@gwharris7
Copy link
Copy Markdown
Contributor

Why

PR #440 introduced PromptForMessagingEndpointAsync, which was declared async but contains no await operators (it only performs synchronous console I/O). With warnings treated as errors, this produced a build break:

AllSubcommand.cs(963,40): Error CS1998: This async method lacks 'await' operators and will run synchronously.

What

Removed the async modifier from PromptForMessagingEndpointAsync and returned its values via Task.FromResult. The Task<string?> return type is preserved, so the caller's await at the call site is unchanged and the original prompt/validation behavior is fully intact.

Verification

dotnet build -c Release on the CLI project now succeeds with 0 errors.

PromptForMessagingEndpointAsync was declared async but contains no await operators (it only performs synchronous console I/O), producing CS1998 introduced by PR 440. Remove the async modifier and return values via Task.FromResult, preserving the Task<string?> signature so the caller's await is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 17:45
@gwharris7 gwharris7 requested review from a team as code owners June 4, 2026 17:45
@github-actions github-actions Bot added the bug Something isn't working label Jun 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gwharris7 gwharris7 requested a review from Copilot June 4, 2026 18:03
@gwharris7 gwharris7 enabled auto-merge (squash) June 4, 2026 18:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gwharris7 gwharris7 merged commit 268a9ab into main Jun 4, 2026
9 of 11 checks passed
@gwharris7 gwharris7 deleted the gwharris7/fix-cs1998-async-warning branch June 4, 2026 21:25
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.

4 participants