AdaptiveCard on Slack: Image with no content
See original GitHub issueVersion Bot: 3.8.1 Channels: Slack and Web
Issue Description
We are using AdaptiveCards. Until last week we have this working in both channels, even in slack the adptive card appear as an image while web mode appears in text (as it is supposed to be).
Since this week, slack adptive card is not working, whenever we make a request to show the card it appears the space of the image, the image exists but no content.
This is 2 image examples: https://bcattachmentsprod.blob.core.windows.net/at13023/BiQrsQYenEx-original https://slack-imgs.com/?c=1&url=https://bcattachmentsprod.blob.core.windows.net/at13023/JTJAU9ye6Q7-original
This works on web channel, the content is correct,
Code Example
//FactSet string title = $“{TicketNumber} - {Title}”;
List<AdaptiveCards.Fact> lstFacts = new List<AdaptiveCards.Fact>() { new AdaptiveCards.Fact(“Ticket Nr”, TicketNumber), new AdaptiveCards.Fact(“Team”, ResponsibleTeam), new AdaptiveCards.Fact(“Status”, Status), };
List<CardElement> listaCards = new List<CardElement>() { UX.AdCards.ContainerFactSet.CreateFactSetWithTitle(ticket.Title, TextColor.Attention, lstFacts), UX.AdCards.ContainerDescription.CreateDescription(“Description”, InitialDescription), };
List<ActionBase> listAction = new List<ActionBase>(); OpenUrlAction o = new OpenUrlAction() { Title = “Show”, Url = ticket.GetLink() }; listAction.Add(o);
var card = new AdaptiveCard() { Body = listaCards, Actions = listAction, Title = title };
//Attachements Attachment attachment = new Attachment() { ContentType = AdaptiveCard.ContentType, Content = card };
var reply = context.MakeMessage(); reply.Attachments.Add(attachment);
return reply;
public static Container CreateDescription(string title, string description, int maxDescriptionSize = 256000, bool removeHTMLImages = true) { //remove images if some appears in text string descriptionAux = description; if (removeHTMLImages) { Regex regex = new Regex(@“<img(.*?)/>”); descriptionAux = regex.Replace(descriptionAux, “##Removed Image##”); }
int val = System.Text.ASCIIEncoding.Unicode.GetByteCount(descriptionAux);
if (val > maxDescriptionSize)
{
descriptionAux = new string(descriptionAux.Take(100).ToArray()) + "... [Texto removido devido ao extenso tamanho]";
}
var converter = new ReverseMarkdown.Converter();
description = converter.Convert(descriptionAux);
Container container = new Container();
if (!string.IsNullOrEmpty(description))
{
container.Items = new List<CardElement>()
{
new TextBlock()
{
Color = TextColor.Dark,
Weight = TextWeight.Bolder,
Text = title,
Wrap = true
},
new TextBlock()
{
Color = TextColor.Default,
Weight = TextWeight.Lighter,
Text = description,
Wrap = true
}
};
}
return container;
}
Reproduction Steps
1.Go to slack 2.Request to show a card
Expected Behavior
Appears the card. Slack: Show card (as an image for now, if possible should appear as text, but not full support yet by microsoft) Web: Show card
Actual Results
The image on Slack appears with no content, full transparent.
UPDATE
I’m receiving the below error in appinsights, and it seems to be related to my issue:
POST to XXX_ASH failed: POST to the bot’s endpoint failed with HTTP status 500POST to the bot’s endpoint failed with HTTP status 500
Microsoft.Bot.Schema.BotException:
at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext (Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null: d:\a\1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs: 312)
Inner exception System.Exception handled at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext:
at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext (Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null: d:\a\1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs: 308)
assembly | Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null |
---|---|
method | Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext |
level | 0 |
line | 312 |
fileName | d:\a\1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs |
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
Hi folks, we’ve patched all of the servers and this should be working as expected now. Please re-open if you’re see any issues. We apologize for any downtime this has caused you!
@matthidinger do you have an ETA on this?