Repository navigation
Robust evva-components query decoding and maintenance task fields - #188
Merged
Merged
Conversation
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>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Querying
evva-componentsagainst 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.ParsingException:ParsingExceptiongets the same constructors as the otherXesarApiExceptions. All encoding and decoding sites now pass a message and the original exception, instead of an emptyParsingException().ParsingExceptioninstead of a timeout on decoding errors: The query listeners inqueryListAsync/queryElementAsynchad no error handling. A decoding error was thrown inside the MQTT message callback, the query deferred was never completed, and callers only saw aConnectionFailedExceptionafter the request timeout.coerceInputValuesfor query responses. Enum values newly added to the Xesar API now fall back tonullfor optional properties instead of failing the whole query. Required enums such asEvvaComponent.componentTypestill fail, but now with a visible cause.maintenanceTaskandmaintenanceTaskReasonstoEvvaComponent: Both fields were added in Xesar MQTT API 1.50.0.maintenanceTaskReasonsis aList<String>, so new reasons don't break decoding..sdkmanrcto 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
EvvaComponentconstructor, so existing positional calls still compile. The no-arg constructor ofParsingExceptionis kept.Test plan
QueryWithUnparsableResultTest: list and element queries with an undecodable response fail withParsingException(instead of a timeout)spotlessCheckplus affected tests); full suite green on the last commit (265 tests)🤖 Generated with Claude Code