Skip to content

Commit

Permalink
fix(api): Web socket decode connection errors (#4606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey committed Apr 16, 2024
1 parent cb9f7e2 commit 549f355
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class WebSocketMessagePayload {
MessageType.connectionAck: ConnectionAckMessagePayload.fromJson,
MessageType.data: SubscriptionDataPayload.fromJson,
MessageType.error: WebSocketError.fromJson,
MessageType.connectionError: WebSocketError.fromJson,
};

static WebSocketMessagePayload? fromJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ void main() {
},
MessageType.error,
),
MessageTypeTestEntry(
{
'id': 'abc-456',
'type': 'connection_error',
'payload': {
'errors': [
{
'errorType': 'UnknownConnectionError',
'message': 'Unknown connection id abc-456',
}
],
},
},
MessageType.connectionError,
),
];

group('WebSocketMessage should create expected messages from JSON', () {
Expand Down

0 comments on commit 549f355

Please sign in to comment.