OfficeDev / Microsoft-Teams-Samples

Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!
MIT License
1.02k stars 776 forks source link

Dynamic typeahead search not working when card rendered in messaging extension #422

Open shubham-betterworks opened 2 years ago

shubham-betterworks commented 2 years ago

Steps to reproduce:

  1. Clone https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-type-ahead-search-adaptive-cards/nodejs.
  2. Add messaging extension command in manifest.json
    "composeExtensions": [
    {
        "botId": "{{Microsoft-App-Id}}",
        "commands": [
            {
                "id": "dynamicsearch",
                "type": "action",
                "title": "Dynamic Search",
                "description": "Dynamic Search",
                "initialRun": false,
                "fetchTask": true,
                "context": [
                    "compose"
                ]
            }
        ]
    }
    ],
  3. Add the following messaging extension invoke handler in TeamsBot

    handleTeamsMessagingExtensionFetchTask(context, action) {
    const userCard = CardFactory.adaptiveCard(this.adaptiveCardForDyanamicSearch());
    
    return {
      task: {
        type: "continue",
        value: {
          card: userCard,
        },
      },
    };
    }
  4. In onInvokeActivity method change last line return null with return super.onInvokeActivity(context);
  5. Start up the bot service

Actual Behaviour

No invoke API call is being made with activity type application/search and shows the following result

Screenshot 2022-08-04 at 3 49 38 PM

Expected behaviour

An API call to invoke endpoint is made with activity type application/search and renders the list of options returned from onInvokeActivity handler

sayali-MSFT commented 2 years ago

@shubham-betterworks - We are looking into this we will get back to you soon.

shubham-betterworks commented 2 years ago

@sayali-MSFT any updates on this?

sayali-MSFT commented 2 years ago

@shubham-betterworks - We are trying to repro the scenario as per above instruction. It is working fine from our end. Microsoft Teams Version 1.5.00.21618 (64-bit)-E

typehead

If There is No value it is showing No Result- typehead1

shubham-betterworks commented 2 years ago

@sayali-MSFT I tested this in the browser earlier when I raised the issue. After your comment, I tested it again today and it is working now. Seems like something was updated at MS Teams end.

Thanks for your help

shubham-betterworks commented 2 years ago

hi @sayali-MSFT, suddenly the dynamic search stopped working in the task module 😞

https://user-images.githubusercontent.com/80667102/185382128-18f28bfe-72b0-429a-8f0d-8aea739a2174.mp4

Can you help by pointing in the right direction to where we should raise this bug?

sayali-MSFT commented 2 years ago

@shubham-betterworks - Are you update the Teams Client ?

sayali-MSFT commented 2 years ago

@shubham-betterworks - We are also facing the same issue after updating the teams Client, We have raised bug for the same and concerned team is looking into it. We will inform you once we get any update.

shubham-betterworks commented 2 years ago

@sayali-MSFT we usually use the web client in the Chrome browser.

Can you please share the link to the issue you raised so that we can track it as well?

sayali-MSFT commented 2 years ago

@shubham-betterworks -The bug link is accessible for internal users only. External users does not have access for this. We will update you once we get any update.

shubham-betterworks commented 2 years ago

@sayali-MSFT any ETA for the fix?

sayali-MSFT commented 2 years ago

@shubham-betterworks - Engineering team working on this issue. Currently we don’t have ETA or Update on this thread. We will update this thread once the bug is fixed

shubham-betterworks commented 2 years ago

@sayali-MSFT we have a new feature dependent on Dynamic typeahead search that is meant to go live in the first week of September. It would help if we can get any idea about ETA on the fix so that we can plan it accordingly. Thanks

sayali-MSFT commented 2 years ago

@shubham-betterworks -We will inform the engineering team and We will update you.

shubham-betterworks commented 2 years ago

@sayali-MSFT any updates?

sayali-MSFT commented 2 years ago

Engineering team working on this issue on priority and We will inform you once we get any update.

shubham-betterworks commented 2 years ago

@sayali-MSFT any updates?

sayali-MSFT commented 2 years ago

@shubham-betterworks -Could you please check it once with the updated version. Now we are able to see the List. Microsoft Teams Version 1.5.00.24124 (64-bit)-E. Thanks !

shubham-betterworks commented 2 years ago

@sayali-MSFT Checked on the above stated version and working fine. What about the older version will it work there as well or to use this feature the teams app should be >= 1.5.00.24124?

sayali-MSFT commented 2 years ago

@shubham-betterworks - Issue is fixed with the latest version. So use this feature the teams app with Latest version. Microsoft Teams Version 1.5.00.24124 (64-bit)-E.

ChetanSharma-msft commented 2 years ago

Hello @shubham-betterworks - Could you please confirm if your issue has resolved or still looking for any help?

shubham-betterworks commented 2 years ago

@ChetanSharma-msft this is still flaky. Sometimes it works (api call for invoke activity is made to get the dynamic result) and sometimes not( no API called)

sayali-MSFT commented 2 years ago

@shubham-betterworks - Thanks for your response, Could you please share the logs for when the scenario doesn't work. Because engineering team also don't able to reproduce the scenario. for investigation purpose please share the logs.

shubham-betterworks commented 2 years ago

@sayali-MSFT there is no request coming to the bot framework server so unfortunately no logs. I inspected via chrome dev tools and there is no API call being made from the MS Teams tabs in the browser

sayali-MSFT commented 2 years ago

@shubham-betterworks -Please share the Bot id and timestamp,So that we can try to get the error from our end.

shubham-betterworks commented 2 years ago

@sayali-MSFT bot id is ba982efe-d324-480f-86b8-f961b9c3e521. earlier timestamp I don't remember. Will try to set it up and hit the endpoint again. will share the timestamp once done.

shubham-betterworks commented 2 years ago

@sayali-MSFT Attaching the video recording as well showing the error in web app opened in chrome browser Recording was done at 16:37-16:38 IST web app in chrome. https://user-images.githubusercontent.com/80667102/200550841-4ded912c-c1f4-4b9a-8473-6e66fa372edd.mp4

Another recording showing the functionality in a native app for MacOS Recording was done at 16:42-16:43 IST for Microsoft Teams Mac OS app https://user-images.githubusercontent.com/80667102/200551079-5b85249e-8409-4c7a-9d04-8fd876af9aec.mp4

Stating the bot id once more ba982efe-d324-480f-86b8-f961b9c3e521

Let me know if I can provide something else to help you guys in debugging

sayali-MSFT commented 2 years ago

@shubham-betterworks - Thanks for providing the information, We will inform the engineering team and We will update you.

sayali-MSFT commented 1 year ago

@shubham-betterworks - Could you please try clearing cache and logging in browser again?

sayali-MSFT commented 1 year ago

@shubham-betterworks -Did you get chance to check?

shubham-betterworks commented 1 year ago

@sayali-MSFT sorry didn't get a chance to look into this. We will get back to you on this in 3-4 days.

shubham-betterworks commented 1 year ago

@sayali-MSFT, I cleared out the cache then logout and login again into Microsoft Teams in the chrome browser. Still the same behaviour

sayali-MSFT commented 1 year ago

@shubham-betterworks - Thank you for confirmation, we are checking it again and get back to you.

dan-c-drawboard commented 1 year ago

@sayali-MSFT Hello - I don't mean to hijack this ticket but I am also facing the same issue.

I'm displaying a type-ahead choice-set input in an adaptive card, via a task/fetch action from my message extension app. When text is entered into the field, it presents with Unable to show options right now as @shubham-betterworks describes above, and I can see no search request is reaching my app.

When I send the same card from my bot in conversation, entering text into the field does produce an incoming search request to my app, so the underlying issue seems to be related to the context of presenting the card as a ME task/fetch command vs. in a conversation with a bot. This behaviour is the same across web and desktop.

My app is intended to be purely a message extension, so not being able to use type-ahead in this context is a detriment. Perhaps this is alluded to in this frustratingly vague excerpt from the documentation: You can't get rich card experiences with dynamic search, such as query-based message extensions.

It would be great if there is a solution forthcoming, but if type-ahead is definitively impossible from an ME task module (ie. not an issue that will be solved), it would be helpful to update the documentation to reflect this explicitly: type-ahead choice-set inputs simply do not work in ME task modules.

sayali-MSFT commented 1 year ago

@dan-c-drawboard -Could you please share the client version, tenant id and video recording, so that we can investigate from our end?

dan-c-drawboard commented 1 year ago

Video recording here MSTeams version 1.6.00.1381 (64-bit) Manifest version 1.15 Bot ID: 54175ced-6598-425d-b3fb-5afdcc6c05d1

I've tested using my own in-development card (see in the recording) and also the dynamic-search card included with the type-ahead sample project.

sayali-MSFT commented 1 year ago

@dan-c-drawboard - Thanks for providing the information. We will inform the engineering team and let you know once we get any update.

dan-c-drawboard commented 1 year ago

@sayali-MSFT Hello - just wanted to see if there was any feedback from the engineering team on this issue?

sayali-MSFT commented 1 year ago

@dan-c-drawboard -Currently, we do not have exact ETA to share,we will let you know once we get any update.

ChetanSharma-msft commented 11 months ago

Hello Everyone, Sorry for delay in response.

We have informed engineering team about the bug and actively checking the updates and let you know if any. Please expect some delay in response.

aya222222 commented 9 months ago

Hi, I hope this helps someone. I did following process and it worked:

Click three dots next to the channel name you want to use this app for. Choose "Manage team" . Choose "Apps" . Click "Upload an app" and upload an app .

shubham-betterworks commented 9 months ago

@sayali-MSFT @ChetanSharma-msft is there any update on the bug fix?

ChetanSharma-msft commented 9 months ago

Hello @shubham-betterworks - Sorry for delay in response. Engineering team is not able to repro this issue, so not able to further investigate it.

Could you please confirm whether you are facing this issue recently and if yes, please let us know if you are facing it with Teams Classic or New Teams Desktop or Web client?

shubham-betterworks commented 9 months ago

@ChetanSharma-msft Ok will check it on different clients and will update you

Vaibhav-MSFT commented 9 months ago

Hello everyone, We tested this sample both on Teams Web and Desktop Client as well as on Classic/New Teams, but there is no issue from our end. The sample seems to be working fine from our end. Screenshot (73) Screenshot (74) Screenshot (75) Sample link- https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-type-ahead-search-adaptive-cards

lilyydu commented 8 months ago

Hi there,

Also facing this issue for Python with adaptive cards:

dyanmic

In my code, I am able to send the activity successfully (will print the generated results)