Skip to content

Commit

Permalink
Make Message.fromResponseBody async
Browse files Browse the repository at this point in the history
Preparation for #1293 (making ICipher.decrypt asynchronous).
  • Loading branch information
lawrence-forooghian committed Jun 1, 2023
1 parent 096a948 commit ce1d837
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/lib/client/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Channel extends EventEmitter {
headers: Record<string, string>,
unpacked?: boolean
) {
return Message.fromResponseBody(body, options, unpacked ? undefined : format);
return await Message.fromResponseBody(body, options, unpacked ? undefined : format);
}).get(params as Record<string, unknown>, callback);
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/lib/types/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ class Message {
context.baseEncodedPreviousPayload = lastPayload;
}

static fromResponseBody(
static async fromResponseBody(
body: Array<Message>,
options: ChannelOptions | EncodingDecodingContext,
format?: Utils.Format
): Message[] {
): Promise<Message[]> {
if (format) {
body = Utils.decodeBody(body, format);
}
Expand Down

0 comments on commit ce1d837

Please sign in to comment.