From 17dd564ccecc01a6fb5cbe13cb9c2b8cceef3374 Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Mon, 11 May 2026 15:08:40 +0100 Subject: [PATCH 1/6] Overdue Updates --- .github/workflows/build.yml | 2 ++ README.md | 14 +++++++++++++- package-lock.json | 14 +++++++------- package.json | 2 +- src/NodeValueReader.cpp | 30 ++++++++++++++++++++++++++++++ src/NodeValueReader.h | 7 +++++++ src/NodeValueWriter.cpp | 30 ++++++++++++++++++++++++++++++ src/NodeValueWriter.h | 7 +++++++ 8 files changed, 97 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea4416e..7a6e5b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,8 @@ jobs: node_version: - 18 - 20 + - 22 + - 24 opendds_branch: - master - latest-release diff --git a/README.md b/README.md index 65ec7cd..bba5f42 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,25 @@ * If using security, you may need to ensure that OpenDDS is built with the same version of OpenSSL used by Node.js ## Tested platforms: -* Node LTS versions 8, 10, 12, 14, 16, 18, 20 +* Node LTS versions 8, 10, 12, 14, 16, 18, 20, 22, 24 * Linux (Ubuntu 20.04) x86_64 using gcc 9.4.0 * Linux (Ubuntu 22.04) x86_64 using gcc 11.2.0 (w/ openssl-1.1.1q) * Windows (Server 2022) x86_64 using Visual Studio Enterprise 2022 * macOS (11.7) x86_54 using clang 13.0 * Other OpenDDS-supported platforms should work, but may required changes to binding.gyp +## Quality of Service (QoS) +When passing QoS objects to entities, note that fields defined as sequences (like `representation`) must be passed as arrays, even if they only contain a single value. For example, to set the `representation` QoS for a DataWriter, the property should be structured like this: + +```javascript +let qos = { + // ... other QoS settings + representation: { + value: ["DDS::XCDR_DATA_REPRESENTATION"] + } +}; +``` + ## Building and running the tests * In OpenDDS directory: ``` diff --git a/package-lock.json b/package-lock.json index 022600d..155246f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,21 +10,21 @@ "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { - "nan": "^2.19.0" + "nan": "^2.26.2" } }, "node_modules/nan": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.1.tgz", - "integrity": "sha512-pfRR4ZcNTSm2ZFHaztuvbICf+hyiG6ecA06SfAxoPmuHjvMu0KUIae7Y8GyVkbBqeEIidsmXeYooWIX9+qjfRQ==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.26.2.tgz", + "integrity": "sha512-0tTvBTYkt3tdGw22nrAy50x7gpbGCCFH3AFcyS5WiUu7Eu4vWlri1woE6qHBSfy11vksDqkiwjOnlR7WV8G1Hw==", "license": "MIT" } }, "dependencies": { "nan": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.1.tgz", - "integrity": "sha512-pfRR4ZcNTSm2ZFHaztuvbICf+hyiG6ecA06SfAxoPmuHjvMu0KUIae7Y8GyVkbBqeEIidsmXeYooWIX9+qjfRQ==" + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.26.2.tgz", + "integrity": "sha512-0tTvBTYkt3tdGw22nrAy50x7gpbGCCFH3AFcyS5WiUu7Eu4vWlri1woE6qHBSfy11vksDqkiwjOnlR7WV8G1Hw==" } } } diff --git a/package.json b/package.json index e8ed841..e6ad91c 100755 --- a/package.json +++ b/package.json @@ -28,6 +28,6 @@ "license": "BSD-3-Clause", "gypfile": true, "dependencies": { - "nan": "^2.19.0" + "nan": "^2.26.2" } } diff --git a/src/NodeValueReader.cpp b/src/NodeValueReader.cpp index 8cf15dc..56a0dcc 100644 --- a/src/NodeValueReader.cpp +++ b/src/NodeValueReader.cpp @@ -191,6 +191,36 @@ bool NodeValueReader::end_element() return true; } +bool NodeValueReader::begin_map(OpenDDS::XTypes::TypeKind /*key_kind*/, OpenDDS::XTypes::TypeKind /*value_kind*/) +{ + return false; +} + +bool NodeValueReader::end_map() +{ + return false; +} + +bool NodeValueReader::begin_key() +{ + return false; +} + +bool NodeValueReader::end_key() +{ + return false; +} + +bool NodeValueReader::begin_value() +{ + return false; +} + +bool NodeValueReader::end_value() +{ + return false; +} + bool NodeValueReader::read_boolean(ACE_CDR::Boolean& value) { return primitive_helper(value, &v8::Value::IsBoolean); diff --git a/src/NodeValueReader.h b/src/NodeValueReader.h index 55cbafa..bad4f97 100644 --- a/src/NodeValueReader.h +++ b/src/NodeValueReader.h @@ -49,6 +49,13 @@ class NodeValueReader : public OpenDDS::DCPS::ValueReader { bool begin_element(); bool end_element(); + bool begin_map(OpenDDS::XTypes::TypeKind key_kind, OpenDDS::XTypes::TypeKind value_kind); + bool end_map(); + bool begin_key(); + bool end_key(); + bool begin_value(); + bool end_value(); + bool read_boolean(ACE_CDR::Boolean& value); bool read_byte(ACE_CDR::Octet& value); #if OPENDDS_HAS_EXPLICIT_INTS diff --git a/src/NodeValueWriter.cpp b/src/NodeValueWriter.cpp index 2831409..22359b9 100644 --- a/src/NodeValueWriter.cpp +++ b/src/NodeValueWriter.cpp @@ -121,6 +121,36 @@ bool NodeValueWriter::end_element() return true; } +bool NodeValueWriter::begin_map(OpenDDS::XTypes::TypeKind /*key_kind*/, OpenDDS::XTypes::TypeKind /*value_kind*/) +{ + return false; +} + +bool NodeValueWriter::end_map() +{ + return false; +} + +bool NodeValueWriter::begin_key() +{ + return false; +} + +bool NodeValueWriter::end_key() +{ + return false; +} + +bool NodeValueWriter::begin_value() +{ + return false; +} + +bool NodeValueWriter::end_value() +{ + return false; +} + bool NodeValueWriter::write_boolean(ACE_CDR::Boolean value) { return primitive_helper(value); diff --git a/src/NodeValueWriter.h b/src/NodeValueWriter.h index 79828e2..7639224 100644 --- a/src/NodeValueWriter.h +++ b/src/NodeValueWriter.h @@ -36,6 +36,13 @@ class NodeValueWriter : public OpenDDS::DCPS::ValueWriter { bool begin_element(ACE_CDR::ULong idx); bool end_element(); + bool begin_map(OpenDDS::XTypes::TypeKind key_kind, OpenDDS::XTypes::TypeKind value_kind); + bool end_map(); + bool begin_key(); + bool end_key(); + bool begin_value(); + bool end_value(); + bool write_boolean(ACE_CDR::Boolean value); bool write_byte(ACE_CDR::Octet value); #if OPENDDS_HAS_EXPLICIT_INTS From 85884366a9c2a1dc79da41d061e18edfdcbcd18e Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Mon, 11 May 2026 15:48:32 +0100 Subject: [PATCH 2/6] update changelog --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bba5f42..b99f0bc 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ $ node-gyp configure build ## Changelog +### Version 0.3.1 + +* Added support for Node.js 22 and 24 (Updated `nan` dependency) +* Fixed an issue where invalid-data callbacks included misleading sample payloads +* Implemented map types in `ValueReader` and `ValueWriter` to satisfy updated OpenDDS interfaces + ### Version 0.3.0 * Update NodeValueWriter and NodeValueReader accordingly to the ValueWriter and ValueReader changes in OpenDDS 3.28.0 From f103f7ac357bdbd4a7495e7ccaf39c74edb4fb33 Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Mon, 11 May 2026 16:16:04 +0100 Subject: [PATCH 3/6] update vcpkg commit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a6e5b2..4e961df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,7 @@ jobs: uses: lukka/run-vcpkg@v11 with: vcpkgDirectory: '${{ github.workspace }}/vcpkg' - vcpkgGitCommitId: 898b728edc5e0d12b50015f9cd18247c4257a3eb + vcpkgGitCommitId: 940f58770cee8e2011bfb4847fb2bd70057301a8 runVcpkgInstall: true - name: 'Set Up MSVC Environment' if: ${{ matrix.m.os == 'windows-2022' }} From 92b2093daf23e4e45d7703528b5700531cdd15fb Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Mon, 11 May 2026 22:12:13 +0100 Subject: [PATCH 4/6] add some caching --- .github/workflows/build.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e961df..dd1d489 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,23 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} + cache: 'npm' + - name: 'Get Repository SHAs' + id: get-shas + shell: bash + run: | + echo "opendds_sha=$(cd OpenDDS && git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "acetao_sha=$(cd ACE_TAO && git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "mpc_sha=$(cd MPC && git rev-parse HEAD)" >> $GITHUB_OUTPUT + - name: 'Cache OpenDDS Build' + uses: actions/cache@v4 + id: cache-opendds + with: + path: | + ACE_TAO + OpenDDS + MPC + key: opendds-build-${{ matrix.m.os }}-${{ matrix.opendds_branch }}-sec${{ matrix.m.dds_security }}-${{ steps.get-shas.outputs.opendds_sha }}-${{ steps.get-shas.outputs.acetao_sha }} - name: 'Install xerces (ubuntu)' if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'ubuntu-22.04' }} run: |- @@ -132,7 +149,7 @@ jobs: echo "BUILD_TARGETS=DCPSInfoRepo_Main;OpenDDS_Rtps_Udp$BUILD_TARGETS" >> $GITHUB_ENV echo "ACE_TEST_LOG_STUCK_STACKS=1" >> $GITHUB_ENV - name: 'Configure & Build OpenDDS (ubuntu / macos)' - if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13' }} + if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13') && steps.cache-opendds.outputs.cache-hit != 'true' }} shell: bash run: |- echo "dds_security=${{ matrix.m.dds_security }}; CONFIG_OPTIONS=${{ env.CONFIG_OPTIONS }}; BUILD_TARGETS=${{ env.BUILD_TARGETS }}" @@ -142,7 +159,7 @@ jobs: . setenv.sh make -j$(getconf _NPROCESSORS_ONLN) ${{ env.BUILD_TARGETS }} - name: 'Configure OpenDDS (windows)' - if: ${{ matrix.m.os == 'windows-2022' }} + if: ${{ matrix.m.os == 'windows-2022' && steps.cache-opendds.outputs.cache-hit != 'true' }} shell: cmd run: |- echo "dds_security=${{ matrix.m.dds_security }}; CONFIG_OPTIONS=${{ env.CONFIG_OPTIONS }}; BUILD_TARGETS=${{ env.BUILD_TARGETS }}" @@ -150,7 +167,7 @@ jobs: configure --no-tests ${{ env.CONFIG_OPTIONS }} perl tools/scripts/show_build_config.pl - name: 'Build OpenDDS (windows)' - if: ${{ matrix.m.os == 'windows-2022' }} + if: ${{ matrix.m.os == 'windows-2022' && steps.cache-opendds.outputs.cache-hit != 'true' }} shell: cmd run: |- cd OpenDDS @@ -257,4 +274,4 @@ jobs: if %errorlevel% neq 0 exit /b %errorlevel% perl run_test.pl node2cpp --rtps --secure if %errorlevel% neq 0 exit /b %errorlevel% - perl run_test.pl node2node --rtps --secure + perl run_test.pl node2node --rtps --secure \ No newline at end of file From cf22c09c2749dfc058296c0006666c468c0b6051 Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Tue, 12 May 2026 10:53:29 +0100 Subject: [PATCH 5/6] macos-14 --- .github/workflows/build.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd1d489..4105e31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: m: - {os: ubuntu-22.04, dds_security: 1} - {os: ubuntu-22.04, dds_security: 0} - - {os: macos-13, dds_security: 1} - - {os: macos-13, dds_security: 0} + - {os: macos-14, dds_security: 1} + - {os: macos-14, dds_security: 0} - {os: windows-2022, dds_security: 1} - {os: windows-2022, dds_security: 0} @@ -85,7 +85,7 @@ jobs: sudo apt-get update sudo apt-get -y install libxerces-c-dev - name: 'Install xerces (macos)' - if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'macos-14' }} run: | brew install xerces-c - name: Setup for run-vcpkg @@ -109,10 +109,10 @@ jobs: if: ${{ matrix.m.os == 'windows-2022' }} uses: ammaraskar/msvc-problem-matcher@0.3.0 - name: 'Set Up Problem Matcher (ubuntu / macos)' - if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }} uses: ammaraskar/gcc-problem-matcher@0.3.0 - name: 'Set environment variables (ubuntu / macos)' - if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }} shell: bash run: |- echo "ACE_ROOT=$GITHUB_WORKSPACE/ACE_TAO/ACE" >> $GITHUB_ENV @@ -125,7 +125,7 @@ jobs: if [ ${{ matrix.m.dds_security }} == 1 ]; then CONFIG_OPTIONS+=" --security" BUILD_TARGETS+=" OpenDDS_Security" - if [ '${{ matrix.m.os }}' == 'macos-13' ]; then + if [ '${{ matrix.m.os }}' == 'macos-14' ]; then CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=/usr/local/opt/openssl@1.1" fi fi @@ -149,7 +149,7 @@ jobs: echo "BUILD_TARGETS=DCPSInfoRepo_Main;OpenDDS_Rtps_Udp$BUILD_TARGETS" >> $GITHUB_ENV echo "ACE_TEST_LOG_STUCK_STACKS=1" >> $GITHUB_ENV - name: 'Configure & Build OpenDDS (ubuntu / macos)' - if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13') && steps.cache-opendds.outputs.cache-hit != 'true' }} + if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14') && steps.cache-opendds.outputs.cache-hit != 'true' }} shell: bash run: |- echo "dds_security=${{ matrix.m.dds_security }}; CONFIG_OPTIONS=${{ env.CONFIG_OPTIONS }}; BUILD_TARGETS=${{ env.BUILD_TARGETS }}" @@ -174,7 +174,7 @@ jobs: call setenv.cmd msbuild -p:Configuration=Debug,Platform=x64 -t:${{ env.BUILD_TARGETS }} -m DDS_TAOv2.sln - name: 'Install (ubuntu / macos)' - if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }} shell: bash run: |- npm install @@ -195,12 +195,12 @@ jobs: echo Core file pattern set to: cat /proc/sys/kernel/core_pattern - name: 'Change Cores Directory Permissions (macos)' - if: ${{ matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.os == 'macos-14' }} shell: bash run: | sudo chmod o+w /cores - name: 'Test (ubuntu / macos)' - if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13' }} + if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }} shell: bash run: |- ulimit -c unlimited @@ -212,7 +212,7 @@ jobs: ./run_test.pl node2cpp --rtps ./run_test.pl node2node --rtps - name: 'Test Secure (ubuntu / macos)' - if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-13') && matrix.m.dds_security == 1 }} + if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14') && matrix.m.dds_security == 1 }} shell: bash run: |- ulimit -c unlimited From 0ced8a7da263bf3e0beda09eb5da9a559bb5ec1c Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Tue, 12 May 2026 15:51:04 +0100 Subject: [PATCH 6/6] use openssl3 for macos runners, update node versions in readme --- .github/workflows/build.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4105e31..a2a7dd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,7 +126,7 @@ jobs: CONFIG_OPTIONS+=" --security" BUILD_TARGETS+=" OpenDDS_Security" if [ '${{ matrix.m.os }}' == 'macos-14' ]; then - CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=/usr/local/opt/openssl@1.1" + CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=$(brew --prefix openssl@3)" fi fi echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV @@ -274,4 +274,4 @@ jobs: if %errorlevel% neq 0 exit /b %errorlevel% perl run_test.pl node2cpp --rtps --secure if %errorlevel% neq 0 exit /b %errorlevel% - perl run_test.pl node2node --rtps --secure \ No newline at end of file + perl run_test.pl node2node --rtps --secure diff --git a/README.md b/README.md index b99f0bc..1862898 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * If using security, you may need to ensure that OpenDDS is built with the same version of OpenSSL used by Node.js ## Tested platforms: -* Node LTS versions 8, 10, 12, 14, 16, 18, 20, 22, 24 +* Node LTS versions 18, 20, 22, 24 * Linux (Ubuntu 20.04) x86_64 using gcc 9.4.0 * Linux (Ubuntu 22.04) x86_64 using gcc 11.2.0 (w/ openssl-1.1.1q) * Windows (Server 2022) x86_64 using Visual Studio Enterprise 2022