Hello, I´ve got an Issue using Icebreaker App.
We successfully deployed the bot in an Azure infrastructure and added the bot in a Channel in MS Teams.
Main problem
we have the problem that not every user receives an invitation, because the Bot throws an error during execution.
Logfile from Azure
{
"parsedStack":[
{
"assembly":"IceBreaker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"method":"Icebreaker.Helpers.AdaptiveCards.PairUpNotificationAdaptiveCard.IsGuestUser",
"level":0,
"line":0
},
{
"assembly":"IceBreaker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"method":"Icebreaker.Helpers.AdaptiveCards.PairUpNotificationAdaptiveCard.GetCard",
"level":1,
"line":0
},
{
"assembly":"IceBreaker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"method":"Icebreaker.IcebreakerBot+<NotifyPair>d__17.MoveNext",
"level":2,
"line":0
},
{
"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx",
"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess",
"level":3,
"line":0
},
{
"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx",
"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification",
"level":4,
"line":0
},
{
"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx",
"method":"System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd",
"level":5,
"line":0
},
{
"assembly":"IceBreaker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"method":"Icebreaker.IcebreakerBot+<MakePairsAndNotify>d__7.MoveNext",
"level":6,
"line":0
}
],
"outerId":"0",
"message":"Object reference not set to an instance of an object.",
"type":"System.NullReferenceException",
"id":"23981744"
}
I guess the problem starts with the pair
object. IcebreakerBot.cs
Could it be possible that the nullpointer object came from IcebreakerBot.cs ?
while searching through the code I ended up here PairUpNotificationAdaptiveCard.cs.
I am not sure why a user is a null pointer. I guess this is because one of the user in the channel is missing company mail.
I do not understand how the pair.Item1.Id
is connected to the user in Azure AD to find out which Azure AD user is causing the problem.
this...TrackTrace(.... {pair.Item1.Id} ....);
The second problem
The second problem is when the Error is raised the entire loop breaks and only a subset of the matches get notified instead of only the failed one get not notified.
Wouldn't it be better to catch the error in the foreach-block as well so the notification can continue.
foreach (var pair in this.MakePairs(optedInUsers).Take(this.maxPairUpsPerTeam))
{
try
{
usersNotifiedCount += await this.NotifyPair(connectorClient, team.TenantId, teamName, pair);
pairsNotifiedCount++;
.........
}
very thanks
max