Repository navigation
Fix empty LocalizedText binary field encoding - #4709
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Three nullable buffer assignments trigger warnings in the warnings-as-errors build.
1 open finding
What changed in this PR
Updates binary encoding to omit empty LocalizedText locale/text fields per OPC UA requirements.
Changes:
- Uses encoding-mask bits only for non-empty fields.
- Adds wire-format and round-trip tests.
| File | Description |
|---|---|
src/Opc.Ua.Types/Encoders/BinaryEncoder.cs |
Omits empty localized-text fields. |
tests/Opc.Ua.Types.Tests/BuiltIn/LocalizedTextTests.cs |
Adds binary encoding tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code coverage✅ Coverage gate passed.
Coverage is above the recorded baseline - consider ratcheting Thresholds live in |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
marcschier
left a comment
There was a problem hiding this comment.
Need to fix the build errors on AOT
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4709 +/- ##
==========================================
- Coverage 82.85% 82.84% -0.01%
==========================================
Files 2267 2267
Lines 345956 345957 +1
Branches 60309 60311 +2
==========================================
- Hits 286640 286625 -15
- Misses 39219 39238 +19
+ Partials 20097 20094 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Normalize plain locale and text inputs and exposed formatted values while preserving translation templates and fallback metadata. Restore ordinary codec round-trip equality and cover null, empty, and whitespace fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep empty-field normalization in LocalizedText and restore the original Locale and Text null checks in BinaryEncoder. Adapt round-trip expectations to canonical values and cover empty and formatted translation-backed fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Description
Omit empty
LocaleandTextfields from the OPC UA Binary DataEncoding forLocalizedText, as required by OPC 10000-6, Section 5.2.2.14, Table 24. Add wire-format tests for empty and non-empty fields, including translation-backed localized text.Validation:
git diff --checkpassed before commit.dotnet build tests\Opc.Ua.Types.Tests\Opc.Ua.Types.Tests.csproj --framework net10.0 --no-restore --verbosity minimal -p:NuGetAudit=falsecould not complete because access tohttps://api.nuget.org/v3/index.jsonfailed withNU1301and a TLS handshake error.Related Issues
No related issue.
Checklist