in aws-greengrass-core-sdk/stream-manager/client.js [305:351]
__handleReadResponse(data, frame) {
if (frame.operation === smData.Operation.ReadMessagesResponse) {
const response = smData.ReadMessagesResponse.fromMap(data);
this.#logger.debug('Received ReadMessagesResponse from server');
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.CreateMessageStreamResponse) {
const response = smData.CreateMessageStreamResponse.fromMap(data);
this.#logger.debug('Received CreateMessageStreamResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.UpdateMessageStreamResponse) {
const response = smData.UpdateMessageStreamResponse.fromMap(data);
this.#logger.debug('Received UpdateMessageStreamResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.DeleteMessageStreamResponse) {
const response = smData.DeleteMessageStreamResponse.fromMap(data);
this.#logger.debug('Received DeleteMessageStreamResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.AppendMessageResponse) {
const response = smData.AppendMessageResponse.fromMap(data);
this.#logger.debug('Received AppendMessageResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.ListStreamsResponse) {
const response = smData.ListStreamsResponse.fromMap(data);
this.#logger.debug('Received ListStreamsResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.DescribeMessageStreamResponse) {
const response = smData.DescribeMessageStreamResponse.fromMap(data);
this.#logger.debug('Received DescribeMessageStreamResponse from server', frame);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.UnknownOperationError) {
this.#logger.error('Received response with UnknownOperation Error from server. You should update your server version');
const response = smData.UnknownOperationError.fromMap(data);
this.#requestMap[response.requestId](response);
} else if (frame.operation === smData.Operation.Unknown) {
this.#logger.error('Received response with unknown operation from server', frame);
try {
const { requestId } = cbor.decodeFirstSync(frame.payload);
this.#requestMap[requestId](frame);
} catch {
// We tried our best to figure out the request id, but it failed.
// We already logged the unknown smData.Operation, so there's nothing
// else we can do at this point
}
} else {
this.#logger.error('Received data with unhandled operation', frame.operation);
}
}