Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
When an operation validator is defined for a full-stack signal, no matter what the rejection error is, on the client side, the reason is: "server rejected the operation".
Expected-behavior
To be able to show a the validation error message that is defined for the server-side Signal instance's validator.
Reproduction
Define an operation validator for signal instance that is returned to the client:
private final ListSignal<Message> chatSignal = new ListSignal<>(Message.class).withOperationValidator(
operation -> {
if (operation instanceof ValueOperation<Message> valueOp) {
if (valueOp.value().text().toLowerCase().contains("bad")) {
return ValidationResult.reject("Bad words are not allowed");
}
}
return ValidationResult.allow();
});
or even with a readonly signal:
private final ListSignal<Message> guestSignal = chatSignal.asReadonly();
When user tries to insert a message to any of the above signals instances, and the operation validation gets rejected, the only available reason for in the onrejected callback is always: "server rejected the operation":
Describe the bug
When an operation validator is defined for a full-stack signal, no matter what the rejection error is, on the client side, the reason is: "server rejected the operation".
Expected-behavior
To be able to show a the validation error message that is defined for the server-side Signal instance's validator.
Reproduction
Define an operation validator for signal instance that is returned to the client:
or even with a readonly signal:
When user tries to insert a message to any of the above signals instances, and the operation validation gets rejected, the only available reason for in the
onrejected
callback is always: "server rejected the operation":System Info
Vaadin: 24.6.0.alpha4 Hilla: 24.6.0.alpha5