Skip to content

Commit

Permalink
Update RealtimeChannel.processMessage to not abort the connection o…
Browse files Browse the repository at this point in the history
…n unrecognized message action

Resolves ECO-5043
  • Loading branch information
VeskeR committed Jan 23, 2025
1 parent 40520b1 commit ee9872b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/common/lib/client/realtimechannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { EncodingDecodingContext, CipherOptions, populateFieldsFromParent } from
import Message, { WireMessage, getMessagesSize, encodeArray as encodeMessagesArray } from '../types/message';
import ChannelStateChange from './channelstatechange';
import ErrorInfo, { PartialErrorInfo } from '../types/errorinfo';
import ConnectionErrors from '../transport/connectionerrors';
import * as API from '../../../../ably';
import ConnectionManager from '../transport/connectionmanager';
import ConnectionStateChange from './connectionstatechange';
Expand Down Expand Up @@ -662,13 +661,13 @@ class RealtimeChannel extends EventEmitter {
}

default:
// RSF1, should handle unrecognized message actions gracefully and don't abort the realtime connection to ensure forward compatibility
Logger.logAction(
this.logger,
Logger.LOG_ERROR,
Logger.LOG_MAJOR,
'RealtimeChannel.processMessage()',
'Fatal protocol error: unrecognised action (' + message.action + ')',
'Protocol error: unrecognised message action (' + message.action + ')',
);
this.connectionManager.abort(ConnectionErrors.unknownChannelErr());
}
}

Expand Down

0 comments on commit ee9872b

Please sign in to comment.