Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket response for invalid request does not work properly #4579

Open
spacemanspiff2007 opened this issue Jan 27, 2025 · 0 comments
Open
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@spacemanspiff2007
Copy link
Contributor

Send this message over websockets (forget json in json for payload)

{
  "topic":"openhab/websocket/filter/type",
  "source":"HABApp",
  "eventId":"WebsocketTypeFilterMsg",
  "type":"WebSocketEvent",
  "payload":["ChannelDescriptionChangedEvent","ChannelTriggeredEvent","ConfigStatusInfoEvent","FirmwareStatusInfoEvent","GroupItemStateChangedEvent","GroupStateUpdatedEvent","ItemAddedEvent","ItemCommandEvent","ItemRemovedEvent","ItemStateChangedEvent","ItemStateEvent","ItemStatePredictedEvent","ItemStateUpdatedEvent","ItemUpdatedEvent","ThingAddedEvent","ThingRemovedEvent","ThingStatusInfoChangedEvent","ThingStatusInfoEvent","ThingUpdatedEvent","WebSocketEvent"]

Receive this:

{
  "type":"WebSocketEvent",
  "topic":"openhab/websocket/response/failed",
  "payload":"Deserialization error: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 130 path $.payload"}

According to Sending events the response should contain eventId which is missing in the response.


Would it be possible to return the invalid request in a request field as a string?
That way the client side tracking of sent messages and mapping them to eventId would not be necessary.
A new WebSocketRequestInvalid event type would be perfect for that.

@spacemanspiff2007 spacemanspiff2007 added the bug An unexpected problem or unintended behavior of the Core label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

No branches or pull requests

1 participant