node-wot icon indicating copy to clipboard operation
node-wot copied to clipboard

chore(binding-opcua) fix application/octet-stream encoding/decoding #…

Open erossignon opened this issue 1 month ago • 3 comments

…1400

erossignon avatar Oct 15 '25 07:10 erossignon

Codecov Report

:x: Patch coverage is 63.76812% with 50 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 77.41%. Comparing base (3325e12) to head (92fcbd8). :warning: Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
...ackages/binding-opcua/src/opcua-protocol-client.ts 29.57% 50 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1449      +/-   ##
==========================================
- Coverage   77.58%   77.41%   -0.17%     
==========================================
  Files          79       84       +5     
  Lines       15331    15989     +658     
  Branches     1445     1519      +74     
==========================================
+ Hits        11894    12378     +484     
- Misses       3414     3585     +171     
- Partials       23       26       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 15 '25 07:10 codecov[bot]

I tried to test the PR with a simple example and I think it does not work as expected. Maybe I am just not understanding it properly.

As mentioned in https://github.com/eclipse-thingweb/node-wot/issues/1400 OPC-UA seems to work fine until I add contentType.

Note: FYI, not adding any contentType at all would mean JSON which is not the case for OPC UA I believe.

If I add "contentType": "application/octet-stream" in a form the codec tries to do work... which has been done already.

Also, it seems that the according code hasn't changed in that regard.

Try to add "contentType": "application/octet-stream" in a simple TD and you will get something like.

throw new Error(`application/octet-stream only supports primitive types (boolean, integer, number, string) - got ${form.type}`);
                          ^

Error: application/octet-stream only supports primitive types (boolean, integer, number, string) - got undefined

danielpeintner avatar Oct 17 '25 08:10 danielpeintner

I tried to test the PR with a simple example and I think it does not work as expected. Maybe I am just not understanding it properly.

As mentioned in #1400 OPC-UA seems to work fine until I add contentType.

Note: FYI, not adding any contentType at all would mean JSON which is not the case for OPC UA I believe.

If I add "contentType": "application/octet-stream" in a form the codec tries to do work... which has been done already.

Also, it seems that the according code hasn't changed in that regard.

Try to add "contentType": "application/octet-stream" in a simple TD and you will get something like.

throw new Error(`application/octet-stream only supports primitive types (boolean, integer, number, string) - got ${form.type}`);
                          ^

Error: application/octet-stream only supports primitive types (boolean, integer, number, string) - got undefined

Could you provide an example of things that reproduce what you're doing. That would be easier to grasp . My understanding should be clearly available in the new unit test added. May be I missed your specific case.

erossignon avatar Oct 17 '25 14:10 erossignon