Forum Discussion
jocsch
Feb 09, 2024Brass Contributor
Task Dialog is not properly closed after submit on Teams Mobile
The review team of Microsoft stumbled upon a behaviour in my app that shows only in the mobile version. So I think it is a bug.
Let me try to explain it, as it is a bit more difficult to provoke.
My app opens a task dialog (HTML content) from an adaptive card message via task/fetch.
When the javascript inside that dialog is submitted via the dialog.url.submit API, the server responds with a continue task and another html dialog. When this is then submitted, the second dialog is closed but the first dialog is still open.
On the web and the desktop the behaviour is different, there both dialogs are closed.
I guess this is the expected result, as for both dialogs submit was called.
This is in detail what happens:
When the user clicks on the action button in the adaptive card, a task/fetch message is send to the backend like this:
{
"name": "task/fetch",
"type": "invoke",
....
"value": {
"data": {
"commandId": "oppenDialog",
"type": "task/fetch"
},
"context": {
"theme": "default"
}
}
}
The server response with a continue message to open the HTML based URL:
{
"task": {
"type": "continue",
"value": {
"title": "Edits",
"height": 250,
"width": 380,
"url": "https://xxx",
}
}
}
The page is opened, the user does his work and finally in the dialog this API call is made:
msTeams.dialog.url.submit({
commandId: "openSecondDialog",
});
According to the API doc, this call is supposed to send the command back to the server and close the task. This is happening on the desktop and the web but not on mobile. (But only, if the server response with another task request).
This is the command the server receives when the dialog submits:
{
"name": "task/submit",
"type": "invoke",
...
"value": {
"data": {
"commandId": "openSecondDialog"
}
}
}
And this is the response to open the second dialog:
{
"task": {
"type": "continue",
"value": {
"title": "Open second dialog",
"height": 300,
"width": 800,
"url": "http://xxx",
}
}
}
In the second dialog msTeams.dialog.url.submit is called to submit, resulting into another task/submit message to the server which then response with an empty request and status code 200.
This leads to the seconds dialog being closed. But on mobile the first dialog is then still visible (which should have been closed after the first submit).
Sorry for not being able to break it down any further. As I said, the behavior is not consistent here between desktop and mobile. I think the desktop version shows the correct behaviour.
Best
- Prasad_Das-MSFT
Microsoft
jocsch - Thanks for raising your issue. It would be really good if you provide the sample code which you used or the deployed app along with repro video, so that we can do analysis and raise a bug if required?
- jocschBrass Contributor
Prasad_Das-MSFT Thanks for looking into it.
I sent the screencasts to the dev community mail address.
Sadly I do not have a minimalistic sample as this issue is a bit more involved with server and client components playing together. I already tried to break the explanation down to the most basic parts of the intercommunication. Is this sufficient?- Prasad_Das-MSFT
Microsoft
jocsch - We are able to repro this issue. We have raised a bug for the same. We will inform you once we get any further update from engineering team.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.