Skip to content

Fix BadContinuationPointInvalid that occurred due to incorrect Browser.BrowseAsync - #4167

Merged
marcschier merged 1 commit into
OPCFoundation:release/1.5.378from
steklabs:hotfix/invalid-cp-browsing
Aug 3, 2026
Merged

Fix BadContinuationPointInvalid that occurred due to incorrect Browser.BrowseAsync#4167
marcschier merged 1 commit into
OPCFoundation:release/1.5.378from
steklabs:hotfix/invalid-cp-browsing

Conversation

@KarenKrill

Copy link
Copy Markdown
Contributor

Fix BadContinuationPointInvalid that occurred due to incorrect handling of an empty continuation point byte array in Browser.BrowseAsync

Description

Temporary hotfix of BadContinuationPointInvalid when calling Browser.BrowseAsync with servers 1.6.0 and higher.

Related Issues

Checklist

  • I have signed the CLA and read the CONTRIBUTING doc.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added all necessary documentation.
  • I have verified that my changes do not introduce (new) build or analyzer warnings.
  • I ran all tests locally using the UA.slnx solution against at least .net framework and .net 10, and all passed.
  • I fixed all failing and flaky tests in the CI pipelines and all CodeQL warnings.
  • I have addressed all PR feedback received.

Further comments

The issue seems to be fixed by a refactoring in the master branch (adding the ByteString type), but I'm proposing a temporary spot hotfix for latest 1.5.378 version

…ng of an empty continuation point byte array in Browser.BrowseAsync
@marcschier
marcschier merged commit f2c796f into OPCFoundation:release/1.5.378 Aug 3, 2026
51 checks passed
@marcschier

Copy link
Copy Markdown
Collaborator

The merge commit for this PR was removed from release/1.5.378 (the branch tip is back at 083dbe2, Prepare 1.5378 maintenance release (#3982)).

Maintenance fixes for the 1.5.378 lineage have to land on master378 first and are then picked into release/1.5.378, so this change was re-submitted against master378 in #4168, together with unit tests that pin the behaviour for null, empty and non empty continuation points.

Thanks @KarenKrill for the fix - the commit in #4168 credits you as co-author.

marcschier added a commit that referenced this pull request Aug 3, 2026
… Browser.BrowseAsync (#4168)

Re-submission of #4167 against `master378`.

# Description

#4167 was merged directly into `release/1.5.378`. Maintenance fixes for
the 1.5.378 lineage have to land on `master378` first, so the commit was
removed from `release/1.5.378` again and the fix is submitted here
instead.

Servers 1.6.0 and higher return a **zero length** continuation point in
the `Browse` response to indicate that no further references are
available. `Browser.BrowseAsync` only checked the continuation point for
`null`, so it issued a `BrowseNext` call with an empty continuation
point, which the server rejects with `BadContinuationPointInvalid`.

The fix follows the continuation point only if it actually contains
data. This is consistent with the already existing
`continuationPoint?.Length > 0` check in the
`OperationCanceledException` filter of the same method.

Credit for the original fix goes to @KarenKrill (#4167).

## Related Issues

- Fixes #3698
- Supersedes #4167

## Checklist

- [x] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [x] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [x] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [x] I ran the affected tests locally.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.

## Further comments

New unit tests in `Tests/Opc.Ua.Client.Tests/BrowserUnitTests.cs` pin
the behaviour for `null`, empty and non empty continuation points.
Verified that the new tests fail without the one line change and pass
with it:

`dotnet test Tests\Opc.Ua.Client.Tests\Opc.Ua.Client.Tests.csproj -f
net10.0 --filter "FullyQualifiedName~BrowserUnitTests"` -> `Failed: 0,
Passed: 3`

The issue does not exist on `master` (2.0), where the `ByteString`
refactoring already handles this.

Co-authored-by: KarenKrill <74286712+KarenKrill@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 75db5878-10f9-4099-993a-5eb969fa080e
@KarenKrill
KarenKrill deleted the hotfix/invalid-cp-browsing branch August 3, 2026 14:26
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.

2 participants