Description
Library name and version
Azure.Communication.Chat 1.1.1
Describe the bug
Same as this bug:
#32623
I create a new ChatThread
```
public async Task CreateChatThreadAsync(string topic, IDictionary<string, string> participants, string accessToken)
{
var client = GetChatClient(accessToken);
var response = await client.CreateChatThreadAsync(
topic,
participants.Select(participant =>
new ChatParticipant(
CommunicationIdentifier.FromRawId(participant.Key)
)
{
DisplayName = participant.Value
}
)
);
var result = response.Value.ChatThread.Id;
return result;
}
then I try to send a message (like propose in the sample there: https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/04.api/a.welcome-event)
```
public async Task<string> SendNewParticipantAddedAsync(
string accessToken,
string threadId
)
{
var client = GetChatClient(accessToken);
var chatThreadClient = client.GetChatThreadClient(threadId);
var response = await chatThreadClient.SendMessageAsync(
@"{
name: 'webchat/join',
value: { }
}",
ChatMessageType.ParticipantAdded
);
var result = response.Value.Id;
return result;
}
Then i have this issue:
An error occurred while writing to logger(s). (Input string was not in a correct format.) (Input string was not in a correct format.) (Input string was not in a correct format.)'
FormatException: Input string was not in a correct format.
Expected behavior
it should not throw an exception and the message should be sent as expected
Actual behavior
i have this issue:
An error occurred while writing to logger(s). (Input string was not in a correct format.) (Input string was not in a correct format.) (Input string was not in a correct format.)'
FormatException: Input string was not in a correct format.
Reproduction Steps
I create a new ChatThread
```
public async Task CreateChatThreadAsync(string topic, IDictionary<string, string> participants, string accessToken)
{
var client = GetChatClient(accessToken);
var response = await client.CreateChatThreadAsync(
topic,
participants.Select(participant =>
new ChatParticipant(
CommunicationIdentifier.FromRawId(participant.Key)
)
{
DisplayName = participant.Value
}
)
);
var result = response.Value.ChatThread.Id;
return result;
}
then I try to send a message (like propose in the sample there: https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/04.api/a.welcome-event)
```
public async Task<string> SendNewParticipantAddedAsync(
string accessToken,
string threadId
)
{
var client = GetChatClient(accessToken);
var chatThreadClient = client.GetChatThreadClient(threadId);
var response = await chatThreadClient.SendMessageAsync(
@"{
name: 'webchat/join',
value: { }
}",
ChatMessageType.ParticipantAdded
);
var result = response.Value.Id;
return result;
}
Environment
.net 6.0
<PackageReference Include="Azure.Communication.Chat" Version="1.1.1" />
<PackageReference Include="Azure.Communication.Identity" Version="1.2.0" />