microsoft / botbuilder-python

The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
http://botframework.com
MIT License
718 stars 286 forks source link

Teams Task Module - Deserialization Error on Teams mobile app for iOS #1872

Closed alinealfa closed 2 years ago

alinealfa commented 2 years ago

Version

botbuilder-integration-aiohttp 4.14.0 Python 3.8.6

Describe the bug

Error when loading Task Module on iOS iOS 14.8.1 / MS Teams v3.20.0

To Reproduce

  1. Deploy sample bot 54.teams-task-module
  2. Say hello and click on Adaptive Card button
  3. Deserialization Error when on iOS iOS 14.8.1 / Microsoft Teams v3.20.0 image

Traceback

(file locations prefix intentionally removed)

  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1293, in _deserialize
    found_value = key_extractor(attr, attr_desc, data)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1064, in rest_key_extractor
    return working_data.get(key)
AttributeError: 'str' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "test_teams_task/env/lib/site-packages/botbuilder/core/bot_adapter.py", line 129, in run_pipeline
    context, callback
  File "test_teams_task/env/lib/site-packages/botbuilder/core/middleware_set.py", line 69, in receive_activity_with_status
    return await self.receive_activity_internal(context, callback)
  File "test_teams_task/env/lib/site-packages/botbuilder/core/middleware_set.py", line 79, in receive_activity_internal
    return await callback(context)
  File "test_teams_task/env/lib/site-packages/botbuilder/core/activity_handler.py", line 78, in on_turn
    invoke_response = await self.on_invoke_activity(turn_context)
  File "test_teams_task/env/lib/site-packages/botbuilder/core/teams/teams_activity_handler.py", line 155, in on_invoke_activity
    TaskModuleRequest, turn_context.activity.value
  File "test_teams_task/env/lib/site-packages/botbuilder/core/serializer_helper.py", line 28, in deserializer_helper
    return deserializer(msrest_cls.__name__, dict_to_deserialize)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1233, in __call__
    return self._deserialize(target_obj, data)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1299, in _deserialize
    value = self.deserialize_data(raw_value, attr_desc['type'])
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1468, in deserialize_data
    return self._deserialize(obj_type, data)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1303, in _deserialize
    raise_with_traceback(DeserializationError, msg, err)
  File "test_teams_task/env/lib/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
    raise error.with_traceback(exc_traceback)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1293, in _deserialize
    found_value = key_extractor(attr, attr_desc, data)
  File "test_teams_task/env/lib/site-packages/msrest/serialization.py", line 1064, in rest_key_extractor
    return working_data.get(key)
msrest.exceptions.DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'

Expected behavior

This sample bot raises no error when interacting on the following platforms:

It was possible to interact with Task Module on iOS iOS 14.8.1 / Microsoft Teams v3.20.0 when deploying these samples (python not included): https://docs.microsoft.com/en-us/samples/officedev/microsoft-teams-samples/ms-teams-task-sample/

Additional context

Initially the error was detected on a bot in production currently deployed in Azure. Since the error message is the same when running bot sample 54.teams-task-module, for the sake of repro we can take this example.

axelsrz commented 2 years ago

This issue could take up a couple of day to get repro. Actively working on it, will post an update when available.

axelsrz commented 2 years ago

Was able to repro, this is due to a change in the Teams client for iOS. Will try to provide a fix soon. Thanks.

tdurnford commented 2 years ago

@axelsrz Any updates on this issue?

carlosscastro commented 2 years ago

@axelsrz can we make progress on the PR for this issue?

alinealfa commented 2 years ago

Thanks @axelsrz @tracyboehrer. Any plan for the next release? (deciding between: build from TestPyPI or wait for the next release)

solanoam commented 2 years ago

was this released?