Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Proposed changes

Per OPC UA Part 4 Section 5.12, CallMethodResult.InputArgumentResults must be empty when StatusCode is Good. The array should only contain status codes when there are input argument errors.

Current behavior incorrectly populates InputArgumentResults with StatusCodes.Good for each valid argument:

// Before: Non-compliant behavior
if (argumentError != null) {
    result.InputArgumentResults.Add(argumentError.StatusCode);
} else {
    result.InputArgumentResults.Add(StatusCodes.Good);  // ❌ Violates spec
}

After fix:

// After: Spec-compliant behavior
if (argumentError != null) {
    result.InputArgumentResults.Add(argumentError.StatusCode);
}
// On success: clear the array
result.InputArgumentResults.Clear();  // ✅ Empty when StatusCode is Good

Changes:

  • Removed population of StatusCodes.Good for valid arguments
  • Clear InputArgumentResults when call succeeds (no argument errors)
  • Updated in CustomNodeManager2 and SampleNodeManager

This ensures CTT compliance for method call status codes.

Related Issues

Related to compliance issue flagged for upcoming CTT release.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

The fix is surgical: only removes non-compliant status code additions and ensures the array is cleared on success. All existing server tests pass without modification.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • reference.opcfoundation.org
    • Triggering command: /usr/bin/curl curl -s REDACTED grep -l (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Method calls shall return proper status codes</issue_title>
<issue_description>### Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

The current behavior is unclear and needs investitagion if the spec is followed:

https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12

The CTT will check this with the next release

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits December 8, 2025 22:32
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix method calls to ensure proper status codes Fix CallMethodResult.InputArgumentResults to comply with OPC UA Part 4 Section 5.12 Dec 8, 2025
Copilot AI requested a review from romanett December 8, 2025 22:39
@marcschier marcschier marked this pull request as ready for review December 9, 2025 07:47
@marcschier marcschier merged commit e170c58 into master Dec 9, 2025
137 of 159 checks passed
@romanett romanett deleted the copilot/fix-status-code-return branch December 9, 2025 19:02
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.

Method calls shall return proper status codes

4 participants