question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AdaptiveCard on Slack: Image with no content

See original GitHub issue

Version 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:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
matthidingercommented, Dec 5, 2017

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!

1reaction
ejadibcommented, Dec 4, 2017

@matthidinger do you have an ETA on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AdaptiveCard on Slack: Image with no content · Issue #985
The image on Slack appears with no content, full transparent. UPDATE. I'm receiving the below error in appinsights, and it seems to be...
Read more >
Adaptive Cards: Slack downrendering of AdaptiveCards ...
We are using AdaptiveCards.We have this working in both channels (Slack and Web), even in slack the adptive card appear as an image...
Read more >
Adaptive Cards
By embedding the Adaptive Card designer directly into our web-based portal our customers can create rich, data-bound cards right from the browser." photo...
Read more >
Image in adaptive card for MS Teams not displaying
Solved: Hello, I have created an adaptive card for a post to MS Teams. Everything works except the image does not display. All...
Read more >
Slack + Adaptive Card Maker by adenin Integrations
Zapier lets you send info between Slack and Adaptive Card Maker by adenin automatically—no code required. With 5,000+ supported apps, the possibilities are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found