Reputation: 21
Describe the bug
On the TeamsFX - TypeScript, the findMember method has become very slow since I have more than 600 persisted conversations in my storage. When I first put my Teams Bot into production, sending proactive notifications to a Teams user took about 7 seconds (With less conversations stored ~10), now it's 15 minutes.
To Reproduce Steps to reproduce the behavior:
Send any adaptive card to my endpoint (See code below) The request is being processed findMember list every conversations on the storage, get them and try to get member informations from an MS API. The user receive the notification, 15-20min after the request started to be processed
More details The bot only send notifications to my users. To find the right user, I use the findMember method available on BotBuilderCloudAdapter.ConversationBot class. The condition used for matching is member.account.email === email. 1:1 conversations are stored in an Azure blob storage compatible bucket.
Find User with Email
const member = await notificationApp.notification.findMember(
m => {
return Promise.resolve(m.account.email === data.email)
}, BotBuilderCloudAdapter.SearchScope.Person);
await member?.sendAdaptiveCard(
AdaptiveCards.declare(notificationTemplate).render({
title: data.header,
message: data.message
})
BOT CREATION
// Create bot.
export const notificationApp = new ConversationBot({
// The bot id and password to create CloudAdapter.
// See https://aka.ms/about-bot-adapter to learn more about adapters.
adapterConfig: {
MicrosoftAppId: config.botId,
MicrosoftAppPassword: config.botPassword,
MicrosoftAppType: "MultiTenant",
},
// Enable notification
notification: {
enabled: true,
store: new BlobStore(connectionString, containerName),
},
});
Upvotes: 1
Views: 48