Skip to content

Add missing input validation to SuspendInstanceAsync and ResumeInstan…#652

Merged
YunchuWang merged 2 commits intomainfrom
wangbill/add-suspend-resume-validation
Feb 27, 2026
Merged

Add missing input validation to SuspendInstanceAsync and ResumeInstan…#652
YunchuWang merged 2 commits intomainfrom
wangbill/add-suspend-resume-validation

Conversation

@YunchuWang
Copy link
Member

…ceAsync

Add Check.NotNullOrEmpty(instanceId) to SuspendInstanceAsync and ResumeInstanceAsync for consistency with all other instance-targeted methods (RaiseEventAsync, TerminateInstanceAsync, GetInstancesAsync, PurgeInstancesAsync, etc.) which already have this validation.

Summary

What changed?

Why is this change needed?

Issues / work items

  • Resolves #
  • Related #

Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to release_notes.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s):
  • AI-assisted areas/files:
  • What you changed after AI output:

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed / Failed (link logs if failed)

Manual validation (only if runtime/behavior changed)

  • Environment (OS, .NET version, components):
  • Steps + observed results:
    1.
    2.
    3.
  • Evidence (optional):

Notes for reviewers

  • N/A

…ceAsync

Add Check.NotNullOrEmpty(instanceId) to SuspendInstanceAsync and
ResumeInstanceAsync for consistency with all other instance-targeted
methods (RaiseEventAsync, TerminateInstanceAsync, GetInstancesAsync,
PurgeInstancesAsync, etc.) which already have this validation.
Copilot AI review requested due to automatic review settings February 27, 2026 21:55
Copy link
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.

Pull request overview

This PR adds missing input validation (Check.NotNullOrEmpty(instanceId)) to SuspendInstanceAsync and ResumeInstanceAsync in GrpcDurableTaskClient, making them consistent with other instance-targeted methods such as RaiseEventAsync, TerminateInstanceAsync, GetInstancesAsync, and PurgeInstancesAsync, which already have this validation.

Changes:

  • Added Check.NotNullOrEmpty(instanceId) at the start of SuspendInstanceAsync in GrpcDurableTaskClient
  • Added Check.NotNullOrEmpty(instanceId) at the start of ResumeInstanceAsync in GrpcDurableTaskClient

@YunchuWang YunchuWang merged commit 540dce3 into main Feb 27, 2026
7 checks passed
@YunchuWang YunchuWang deleted the wangbill/add-suspend-resume-validation branch February 27, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants