Skip to content

Robust evva-components query decoding and maintenance task fields - #188

Merged
andreasgrill merged 5 commits into
mainfrom
fix/evva-component-query-parsing
Sep 13, 2026
Merged

andreasgrill merged 5 commits into
mainfrom
fix/evva-component-query-parsing

Conversation

@andreasgrill

Copy link
Copy Markdown
Collaborator

Summary

Querying evva-components against newer Xesar versions (MQTT API 1.50.0+) could fail, and the actual decoding error was not visible to callers. This PR makes query decoding more robust and diagnosable, and adds the new fields.

  • fix: preserve the original cause in ParsingException: ParsingException gets the same constructors as the other XesarApiExceptions. All encoding and decoding sites now pass a message and the original exception, instead of an empty ParsingException().
  • fix: fail queries with ParsingException instead of a timeout on decoding errors: The query listeners in queryListAsync / queryElementAsync had no error handling. A decoding error was thrown inside the MQTT message callback, the query deferred was never completed, and callers only saw a ConnectionFailedException after the request timeout.
  • feat: ignore unknown enum values in optional query response fields: Enables coerceInputValues for query responses. Enum values newly added to the Xesar API now fall back to null for optional properties instead of failing the whole query. Required enums such as EvvaComponent.componentType still fail, but now with a visible cause.
  • feat: add maintenanceTask and maintenanceTaskReasons to EvvaComponent: Both fields were added in Xesar MQTT API 1.50.0. maintenanceTaskReasons is a List<String>, so new reasons don't break decoding.
  • build: add .sdkmanrc to pin JDK 11: Gradle 8.1.1 does not start with newer JDKs (for example 26).

The new fields are appended to the end of the EvvaComponent constructor, so existing positional calls still compile. The no-arg constructor of ParsingException is kept.

Test plan

  • New unit tests for decoding with unknown fields, unknown optional enum values, unknown maintenance task reasons, the new fields, and the preserved cause
  • New QueryWithUnparsableResultTest: list and element queries with an undecodable response fail with ParsingException (instead of a timeout)
  • Each commit verified separately in a clean worktree (spotlessCheck plus affected tests); full suite green on the last commit (265 tests)

🤖 Generated with Claude Code

andreasgrill and others added 5 commits September 13, 2026 19:03
Gradle 8.1.1 does not start with newer JDKs (e.g. JDK 26 fails with
"What went wrong: 26.0.1"). The project toolchain is Java 11.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ParsingException was always thrown without a cause, so the actual
decoding error (e.g. the failing JSON path) was only visible in the log.
Add the same constructors as the other XesarApiExceptions and pass the
original exception at all encoding and decoding sites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ing errors

Decoding errors of query responses were thrown inside the MQTT message
callback. The query deferred was never completed, so callers only got a
ConnectionFailedException after the request timeout, and the exception
escaped into the MQTT client's messageArrived callback.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Enable coerceInputValues for query responses, so that enum values newly
added to the Xesar API fall back to the property default (null) instead
of failing the whole query. This applies to all query responses; required
enum properties like EvvaComponent.componentType still fail.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both fields were added to the evva-components query in Xesar MQTT API
1.50.0. maintenanceTaskReasons is kept as a list of strings, so that new
reasons don't break decoding.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@andreasgrill
andreasgrill merged commit 8823171 into main Sep 13, 2026
2 checks passed
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