Skip to content

Commit

Permalink
Rename Channels#onChannelMessage
Browse files Browse the repository at this point in the history
As part of #1293 (making ICipher.decrypt asynchronous), we will be
making this method async, and another method will wish to wait on its
completion. As such, this should no longer be named as if it were only
an informative callback.
  • Loading branch information
lawrence-forooghian committed Jun 1, 2023
1 parent a56148c commit 932a274
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/common/lib/client/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ class Channels extends EventEmitter {
}
}

onChannelMessage(msg: ProtocolMessage) {
processChannelMessage(msg: ProtocolMessage) {
const channelName = msg.channel;
if (channelName === undefined) {
Logger.logAction(
Logger.LOG_ERROR,
'Channels.onChannelMessage()',
'Channels.processChannelMessage()',
'received event unspecified channel, action = ' + msg.action
);
return;
Expand All @@ -97,7 +97,7 @@ class Channels extends EventEmitter {
if (!channel) {
Logger.logAction(
Logger.LOG_ERROR,
'Channels.onChannelMessage()',
'Channels.processChannelMessage()',
'received event for non-existent channel: ' + channelName
);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/common/lib/transport/connectionmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1973,13 +1973,13 @@ class ConnectionManager extends EventEmitter {
* before it's become active (while waiting for the old one to become
* idle), message can validly arrive on it even though it isn't active */
if (onActiveTransport || onUpgradeTransport) {
this.realtime.channels.onChannelMessage(message);
this.realtime.channels.processChannelMessage(message);
} else {
// Message came in on a defunct transport. Allow only acks, nacks, & errors for outstanding
// messages, no new messages (as sync has been sent on new transport so new messages will
// be resent there, or connection has been closed so don't want new messages)
if (Utils.arrIndexOf([actions.ACK, actions.NACK, actions.ERROR], message.action) > -1) {
this.realtime.channels.onChannelMessage(message);
this.realtime.channels.processChannelMessage(message);
} else {
Logger.logAction(
Logger.LOG_MICRO,
Expand Down

0 comments on commit 932a274

Please sign in to comment.