MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / _handleMessage

Method _handleMessage

apps/client/src/code/realtime/client.ts:302–321  ·  view source on GitHub ↗
(message: Uint8Array)

Source from the content-addressed store, hash-verified

300 // Handle messages
301
302 private _handleMessage(message: Uint8Array) {
303 this._logger.sub('_handleMessage').info('Received message');
304
305 const decoder = new decoding.Decoder(message);
306 const messageType = decoding.readVarUint(decoder);
307
308 switch (messageType) {
309 case RealtimeServerMessageType.RESPONSE:
310 this._handleResponse(decoder);
311 break;
312 case RealtimeServerMessageType.DATA_NOTIFICATION:
313 this._handleDataNotification(decoder);
314 break;
315 case RealtimeServerMessageType.USER_NOTIFICATION:
316 void this._handleUserNotification(decoder);
317 break;
318 default:
319 throw new Error(`Unknown message type ${messageType}`);
320 }
321 }
322 private _handleResponse(decoder: decoding.Decoder) {
323 const numCommands = decoding.readVarUint(decoder);
324

Callers 1

connectMethod · 0.45

Calls 4

subMethod · 0.80
_handleResponseMethod · 0.80

Tested by

no test coverage detected