botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Microsoft Teams rendering is broken.

Open james-lawrence opened this issue 9 years ago • 21 comments

Sometime this week the rendering for markdown was broken for microsoft teams.

"text":"Hello there\n","textFormat":"markdown"

renders as:

screenshot from 2016-12-08 14-29-47

james-lawrence avatar Dec 08 '16 19:12 james-lawrence

I am unable to reproduce the issue with the text and textFormat fields matching what you specified above.

Do you have the exact message JSON your bot replied with when you saw the issue?

siduppal avatar Dec 08 '16 21:12 siduppal

yes, I'll get it for you tomorrow morning.

james-lawrence avatar Dec 08 '16 22:12 james-lawrence

POST /v3/conversations/19:c3ec28d6-7188-45ec-996a-1e9341a6e307_0b45f374-86b1-4dcd-9e4f-bf17f573d6fc@unq.gbl.spaces/activities HTTP/1.1
Host: skype.botframework.com
User-Agent: Go-http-client/1.1
Content-Length: 516
Accept: application/json
Accept: text/json
Content-Type: application/json
Accept-Encoding: gzip
[1B blob data]
{"attachments":null,"channelId":"msteams","conversation":{"id":"19:c3ec28d6-7188-45ec-996a-1e9341a6e307_0b45f374-86b1-4dcd-9e4f-bf17f573d6fc@unq.gbl.spaces"},"entities":null,"from":{"id":"28:0b45f374-86b1-4dcd-9e4f-bf17f573d6fc"},"localTimestamp":"2016-12-09T12:54:50.876Z","membersAdded":null,"membersRemoved":null,"recipient":{"id":"c3ec28d6-7188-45ec-996a-1e9341a6e307"},"serviceUrl":"https://skype.botframework.com","text":"Hey\n","textFormat":"markdown","timestamp":"2016-12-09T12:54:50.876Z","type":"message"}
HTTP/1.1 201 Created
Content-Length: 76
Cache-Control: no-store, must-revalidate, no-cache
Content-Type: application/json; charset=utf-8
Contextid: tcid=5814923934324425586,server=EAP010201162142
Date: Fri, 09 Dec 2016 12:54:49 GMT
Pragma: no-cache
Server: Microsoft-IIS/8.0
Strict-Transport-Security: max-age=31536000
X-Powered-By: ASP.NET
[1B blob data]
{"id":"0:1f84W4O6YLHQUtRb9so0L2S4zZbf-EklYKu-ntN9LdBJiVTbW07JolMtXpBDX_pTY"}

james-lawrence avatar Dec 09 '16 12:12 james-lawrence

any update on this?

james-lawrence avatar Dec 14 '16 13:12 james-lawrence

We are investigating

siduppal avatar Dec 15 '16 05:12 siduppal

well let me know if there is anything I can do to help.

james-lawrence avatar Dec 15 '16 13:12 james-lawrence

Hey there: we can't repro here. Are you still seeing the issue?

RichMoeMSFT avatar Dec 20 '16 05:12 RichMoeMSFT

yes. no change. did you guys adjust the service url for ms teams? I'm still using the skype endpoint.

james-lawrence avatar Dec 20 '16 18:12 james-lawrence

but something changed on the botframework's endpoint as it went from rendering properly to rendering html. I feel like its getting rendered twice somewhere after it leaves our system into yours.

things to note: this happens when in the teams UI? not skypes. not sure if that could be why you can't reproduce.

james-lawrence avatar Dec 20 '16 18:12 james-lawrence

I'm not seeing this in Teams UI, desktop or web, nor in the emulator, and I'm hitting skype.botframework.com. I've tried recreating your exact message from above, and even played with other markdown formats, but it's all displaying correctly.

RichMoeMSFT avatar Dec 20 '16 20:12 RichMoeMSFT

hmm interesting. now is there any configuration that may impact this that is done over at https://dev.botframework.com/bots?

for example is microsoft teams enabled for you? what about skype? (we have both enabled) What about how the api credentials were created? we did that at https://apps.dev.microsoft.com/.

Will providing you with an environment this is occurring in help you? I'm happy to invite one of you to our teams development and give you the bot id to message. I'm really not sure what could be causing this if you replayed exactly the messages I provided above.

james-lawrence avatar Dec 20 '16 21:12 james-lawrence

All I did was take a sample bot (Send Attachment Bot Sample in my case) and modify output to display markdown. I registered it with both Teams and Skype. Perhaps that would be a quick test for you to see if there's something specific in your implementation?

RichMoeMSFT avatar Dec 21 '16 18:12 RichMoeMSFT

@RichMoeMSFT alright I've discovered the issue (finally had a chance to investigate this particular issue)

apparently I was stripping the 8:orgid: prefix from the recipient field. without this it renders improperly I would expect an error of some sort. instead my message gets mangled based on the recipient id.... which doesnt really make sense. I'd understand the serviceURL or channelId influencing the rendering, but the recipient id?

james-lawrence avatar Jan 03 '17 18:01 james-lawrence

I was doing the stripping to map the ID's to the microsoft o365 accounts, and I was reusing the stripped version to send the message (accidentally). Still feel this behaviour is a bug.

james-lawrence avatar Jan 03 '17 19:01 james-lawrence

Thanks for the clarification. FYI we'll be providing more channel-specific schema guidance for Teams soon. That is a field you should not count on extracting meaningful data from.

RichMoeMSFT avatar Jan 09 '17 21:01 RichMoeMSFT

@RichMoeMSFT normally I'd agree with you but the lack of a way to retrieve accounts via the api makes it a necessary evil in order to correctly map people from a office organization who havent sent the bot a message. hence extracting the o365 id out of the message.

james-lawrence avatar Jan 09 '17 23:01 james-lawrence

We'll have additional support coming soon which should allow you to get the information you need, without having to do evil ;)

RichMoeMSFT avatar Jan 10 '17 05:01 RichMoeMSFT

Figured there would eventually be a way whichis why i took the shortcut. I still think the rendering is a bug though. ;) Question will the ids map cleanly to o365?

james-lawrence avatar Jan 10 '17 22:01 james-lawrence

@RichMoeMSFT looks like a change was made to the from ID format, however there still isn't a way to generate a list of ids from the api. makes mapping internal system ID's to msteams ID's impossible. particularly since I'm not sure what the encoding format is being used for the new ID.

new format:

"from": {
"id": "29:1xUE_8WVVQxzRRQw54AkdMuRMeIfaDgHB89Nfph2bAD_BPYuyi6ulw-r80Mhv4Q5p4G8lCViMyxScjYwMQo6uGg",
"name": "James Lawrence"
}

old format:

"from": {
"id": "8:orgid:c3ec28d6-7188-45ec-996a-1e9341a6e307",
"name": "James Lawrence"
}

james-lawrence avatar Jan 27 '17 14:01 james-lawrence

@james-lawrence are you still experiencing this issue?

carlosscastro avatar Mar 09 '17 18:03 carlosscastro