Skip to content

Clear message fails due to accessing undefined "meta_result" variable #476

@meralan

Description

@meralan

What is the current behavior?

You get an exception when you send clear message due to accessing an undefined variable while logging.

Exception:

 "description": "Exception in AsyncSpeakWebSocketClient._process_text",
 "message": "cannot access local variable 'meta_result' where it is not associated with a value",

problematic line in Async Client here.

case SpeakWebSocketEvents.Cleared:
  clear_result: ClearedResponse = ClearedResponse.from_json(message)
  self._logger.verbose("ClearedResponse: %s", meta_result)
  await self._emit(
      SpeakWebSocketEvents(SpeakWebSocketEvents.Cleared),
      cleared=clear_result,
      **dict(cast(Dict[Any, Any], self._kwargs)),

problematic line in Client here

 case SpeakWebSocketEvents.Cleared:
    clear_result: ClearedResponse = ClearedResponse.from_json(message)
    self._logger.verbose("ClearedResponse: %s", meta_result)
    self._emit(
        SpeakWebSocketEvents(SpeakWebSocketEvents.Cleared),
        cleared=clear_result,
        **dict(cast(Dict[Any, Any], self._kwargs)),

Expected behavior

...
clear_result: ClearedResponse = ClearedResponse.from_json(message)
self._logger.verbose("ClearedResponse: %s", clear_result)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions