Skip to content

fix(eon): handle rebirth commands and timestamp-less CMD payloads - #67

Merged
dpazj merged 2 commits into
masterfrom
fix/receive-command
Nov 3, 2026
Merged

dpazj merged 2 commits into
masterfrom
fix/receive-command

Conversation

@dpazj

@dpazj dpazj commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes edge:ReceiveCommandTest, which timed out because the node never processed the TCK's rebirth command.

  • Accept command payloads that omit the payload timestamp by using the receive time (MessageMetrics::from_payload_lenient), for both NCMD and DCMD.
  • Stop data publishes before a command-triggered rebirth, so no DATA messages are sent after the rebirth request.
  • Publish NBIRTH and all DBIRTHs from the same session when rebirthing.

Why

The Sparkplug TCK's rebirth NCMD has no payload timestamp:

Payload.newBuilder()
    .addMetrics(Metric.newBuilder().setName(NODE_CONTROL_REBIRTH)...)
    .build()

MessageMetrics::try_from(Payload) returns MissingTimestamp, so srad logged Received invalid CMD payload - ignoring request and never rebirthed. The TCK's rebirth-action-1 and rebirth-action-2 assertions then failed and the test timed out.

Result

edge:ReceiveCommandTest   PASS   14 assertions: 14 passed

Stable across 8 consecutive runs against tck-node. Regression tests:

edge:SendDataTest          PASS   40 passed, 4 not executed
edge:SendComplexDataTest   PASS   48/48
edge:SessionTerminationTest PASS  25 passed, 10 not executed

cargo fmt --all --check, cargo clippy --all-targets -- -D warnings, and cargo test pass.

dpazj added 2 commits November 3, 2026 20:40
The Sparkplug TCK's rebirth command omits the payload timestamp, and srad
rejected the whole NCMD, so the node never rebirthed. Accept command
payloads without a timestamp by using the time the command was received,
for both node and device commands.

Also stop data publishes before a command-triggered rebirth so no DATA is
sent after the rebirth request, and publish the node and device births
from the same session.

- Add MessageMetrics::from_payload_lenient.
- Add Node::command_rebirth, which marks the node un-birthed before
  publishing the birth sequence.
- Cover the lenient conversion with a unit test.
@dpazj
dpazj merged commit 6936afb into master Nov 3, 2026
7 checks passed
@dpazj
dpazj deleted the fix/receive-command branch November 3, 2026 20:51
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.

1 participant