Skip to content

fix: the node update echo is typed, not flat Resources - #138

Merged
olavgg merged 1 commit into
mainfrom
fix/node-update-echo-is-typed
Sep 18, 2026
Merged

olavgg merged 1 commit into
mainfrom
fix/node-update-echo-is-typed

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

POST /resources/update answered with each node serialized as a plain Resource whatever its real type. The api's node-update refactor made the pipeline per-type and the echo followed, so a node now comes back in the shape of its own kind — a timeseries with its unit and valueType, an asset with its geoLocation.

The old signature was not merely lossy. Resource requires isRoot, which only resources and assets carry, so ResourceService::update on a timeseries or a function failed to deserialize:

missing field `isRoot` at line 1 column 244

Nothing caught it because every update test in src/resources/ updates a plain resource, which does carry isRoot. update_echo_is_typed_per_node_type drives the two types that broke and asserts each echoes as its own Node variant.

ResourceService::update and its blocking mirror now return GraphDataWrapper<Node>. This is a breaking change to a public signature.

PyGraphResult::from_resource_wrapper existed only for this one flat echo and is removed; both binding services use from_wrapper, so Python callers get typed node objects from resources.update as they already do from every read.

`POST /resources/update` answered with each node serialized as a plain
`Resource` whatever its real type. The api's node-update refactor made the
pipeline per-type and the echo followed, so a node now comes back in the shape
of its own kind — a timeseries with its `unit` and `valueType`, an asset with
its `geoLocation`.

The old signature was not merely lossy. `Resource` requires `isRoot`, which
only resources and assets carry, so `ResourceService::update` on a timeseries
or a function failed to *deserialize*:

    missing field `isRoot` at line 1 column 244

Nothing caught it because every update test in `src/resources/` updates a plain
resource, which does carry `isRoot`. `update_echo_is_typed_per_node_type` drives
the two types that broke and asserts each echoes as its own `Node` variant.

`ResourceService::update` and its blocking mirror now return
`GraphDataWrapper<Node>`. This is a breaking change to a public signature.

`PyGraphResult::from_resource_wrapper` existed only for this one flat echo and
is removed; both binding services use `from_wrapper`, so Python callers get
typed node objects from `resources.update` as they already do from every read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj requested a review from olavgg September 18, 2026 12:49
@olavgg
olavgg merged commit ca7a388 into main Sep 18, 2026
17 of 18 checks passed
@olavgg
olavgg deleted the fix/node-update-echo-is-typed branch September 18, 2026 14:07
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