Skip to content

Fix wildcard regression in subscribe_current_values on v2 (closes #53)#59

Open
aki1770-del wants to merge 1 commit intoeclipse-kuksa:mainfrom
aki1770-del:fix/v2-subscribe-current-values-wildcard-53
Open

Fix wildcard regression in subscribe_current_values on v2 (closes #53)#59
aki1770-del wants to merge 1 commit intoeclipse-kuksa:mainfrom
aki1770-del:fix/v2-subscribe-current-values-wildcard-53

Conversation

@aki1770-del
Copy link
Copy Markdown

What

Restores branch-path support in subscribe_current_values on the v2 code path.
Since 0.5.1 preferred v2, calls like client.subscribe_current_values(['Vehicle'])
fail with NOT_FOUND: the v2 Subscribe RPC only accepts fully-qualified leaf
paths. v1 Subscribe accepted branch paths natively, so this is a regression for
existing users.

Fixes #53.

How

  • On the v2 path, catch NOT_FOUND from the first Subscribe attempt.
  • Expand the input paths via ListMetadata(root=path) — the v2-native way to
    enumerate signals under a branch — and retry Subscribe with the resulting
    leaves.
  • Leaf paths stay on the fast path: they never trigger the retry, so no extra
    RPC in the common case.
  • Trailing .* (e.g. Vehicle.Cabin.*) is stripped before lookup so both the
    v1 idiom ['Vehicle'] and the explicit wildcard form work.
  • The existing UNIMPLEMENTED → v1 fallback is preserved for old databrokers.

Scope

Strictly subscribe_current_values (sync + async). subscribe_target_values
has the same shape but is out of scope here — happy to file a symmetric fix in
a follow-up if the approach looks right.

Existing behavior audit

  • v2_subscribe implementation: kuksa-client/kuksa_client/grpc/aio.py:537
    passes paths directly into SubscribeRequest; no client-side expansion.
  • _prepare_v2_list_metadata_request: kuksa-client/kuksa_client/grpc/__init__.py:907
    already builds the ListMetadata request shape. Reused here.
  • val.proto semantics for ListMetadata: "Shall correspond to a VSS branch,
    e.g. Vehicle, Vehicle.Cabin. Metadata for all signals under that branch
    will be returned."
    (kuksa/val/v2/val.proto)
  • v1 get_metadata still works with wildcards (per the issue reporter) — which
    is why this is a clear regression from the v2 switch, not a missing feature.

Prior art / related

Tests

  • test_subscribe_current_values — unchanged, still passing (leaf-path fast path)
  • test_subscribe_current_values_branch_path_expansion — new; asserts that on
    NOT_FOUND the client retries v2_subscribe with expanded leaves
  • Full suite: 274/274 pass locally

Not tested (would appreciate reviewer input)

  • Integration against a live databroker v0.6.0 — done by reporter per issue;
    happy to add an integration test if the project has a pattern for that.

…ipse-kuksa#53)

The v2 Subscribe RPC only accepts fully-qualified leaf paths, so passing
a branch path like `['Vehicle']` — which v1 Subscribe accepted as a
wildcard — now fails with NOT_FOUND since 0.5.1. This breaks existing
user code that worked on 0.4.x.

Restore the prior behavior by catching NOT_FOUND from v2 Subscribe and
retrying with paths expanded via ListMetadata(root=path). Leaf paths
continue on the fast path (no extra RPC). The UNIMPLEMENTED fallback
to v1 Subscribe is preserved for old databrokers.

- kuksa-client/kuksa_client/grpc/aio.py: async path, new _expand_v2_branch_paths helper.
- kuksa-client/kuksa_client/grpc/__init__.py: sync mirror of the same change.
- kuksa-client/tests/test_grpc.py: new test asserting branch-path expansion on NOT_FOUND.

Trailing `.*` in paths (e.g. `Vehicle.Cabin.*`) is stripped before lookup
so both the idiomatic v1 form and the explicit wildcard form work.

Signed-off-by: Komada (aki1770-del) <aki1770@gmail.com>
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.

Wildcard usage for subscribe_current_values not working anymore since 0.5.1

1 participant