Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js Teams botbuilder package: Message extension - Responding with a card inserted into the compose message area, inserts card in compose area for all chat windows within teams app #278

Open
sanasz91mdev opened this issue Dec 7, 2022 · 7 comments

Comments

@sanasz91mdev
Copy link

sanasz91mdev commented Dec 7, 2022

Describe the bug
Node.js Teams botbuilder package: Responding with a card inserted into the compose message area inserts card in compose area for all chats within teams app

sample code

export async function processExtensionSubmit(context: any, action: any) {
    try {
        var cardTemplate = require('../adaptiveCards/submit-ticket-msg-extension.json');
        var member = await Utils.getMemberInfo(context);
        var ticket = new Ticket();
        var ticketResponse = await ticket.submitTickets(action.data, member.email);
        if (ticketResponse.result == true) {
            var parameters: any = {};
            parameters.ticketId = { ticketId: ticketResponse.data.id, title: ticketResponse.data.title, type: action.data.internalCategory == "true" ? "Internal" : "External" };
            const card = Utils.renderAdaptiveCard(cardTemplate, parameters.ticketId);

            //send noti to channel

            await sendNotificationToChannel(context, card);

            //send a composition extension
            return Promise.resolve({
                composeExtension: {
                    attachments: [card],
                    attachmentLayout: "list",
                    type: 'result'
                }
            } as MessagingExtensionActionResponse);
        }
        else {
            return {
                task: {
                    type: "message",
                    value: "Could not process request. An Error occurred."
                }
            } as MessagingExtensionActionResponse;

        }
    } catch (error) {
        console.error(error);
        return ({
            task: {
                type: "message",
                value: "Could not process request. An Error occurred."
            }
        }) as MessagingExtensionActionResponse;
    }
}

Expected behavior
Card sent as a Message Extension response with in composeExtension should appear in compose area Only in chat where message extension action was clicked, not in every chat window

Screenshots
see how performing a n action via message extension creates a ticket in compose message area of ALL chat windows rather than creating in only the compose area of chat window where message extension action was clicked

4

5

1

3

2

  • OS: Windows 10 Enterprise
  • tool Visual Studio Code
  • Teams app development using BotBuilder package on : Node.js

I reffered the documentation below

Respond with a card inserted into the compose message area
The most common way to respond to the composeExtension/submitAction request is with a card inserted into the compose message area. The user submits the card to the conversation. For more information on using cards, see cards and card actions.

Microsoft docs - Build message extensions)**

Is there something wrong with the code? Why is response appearing in compose area of all chat windows? what should i do to get rid of it?

@ghost
Copy link

ghost commented Dec 7, 2022

Hi sanasz91mdev! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@ghost ghost added the needs triage 🔍 label Dec 7, 2022
@Nivedipa-MSFT
Copy link

@sanasz91mdev - We will test this and update you soon.

@sanasz91mdev
Copy link
Author

@sanasz91mdev - We will test this and update you soon.

sure ... i hope the problem is clear? let me know if you need anything else to replicate this.

@sanasz91mdev sanasz91mdev changed the title Node.js Teams botbuilder package: Responding with a card inserted into the compose message area inserts card in compose area for all chats within teams app Node.js Teams botbuilder package: Message extension - Responding with a card inserted into the compose message area inserts card in compose area for all chats within teams app Dec 7, 2022
@Nivedipa-MSFT
Copy link

@sanasz91mdev - We are able to repro your issue and raised the bug for the same. We will let you know once we have any updates on it.

@sanasz91mdev
Copy link
Author

@sanasz91mdev - We are able to repro your issue and raised the bug for the same. We will let you know once we have any updates on it.

@Nivedipa-MSFT is it teams app bug ? will it require teams app update or code changes to my bot? i am planning to roll out the teams bot for my organization.

@sanasz91mdev sanasz91mdev changed the title Node.js Teams botbuilder package: Message extension - Responding with a card inserted into the compose message area inserts card in compose area for all chats within teams app Node.js Teams botbuilder package: Message extension - Responding with a card inserted into the compose message area, inserts card in compose area for all chat windows within teams app Dec 8, 2022
@Nivedipa-MSFT
Copy link

@sanasz91mdev - This is Teams app bug. After bug fix it will require Teams app update.

@Nivedipa-MSFT
Copy link

@sanasz91mdev - This bug has been fixed now. Could you please update the Teams version to the latest version and check again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants