Skip to content

Copy job history to avoid InvalidOperationException #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martincostello
Copy link

Copy job history from storage before returning to avoid mutating state.

Surfaced via a failing test in open-telemetry/opentelemetry-dotnet-contrib.

Avoiding for now via open-telemetry/opentelemetry-dotnet-contrib#2835.

Copy job history from storage before returning to avoid mutating state.
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 09:28
Copy link

@Copilot 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 pull request copies the job history before returning it to prevent state mutations and avoid an InvalidOperationException.

  • Clone the job History using ToList() to ensure subsequent modifications do not affect the stored state.
  • Maintain the existing object properties while addressing the failing test.

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.

1 participant