Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: dialog.url.open() does not work in configurable tabs in group chats in New Teams (reloading the tab works) #2288

Open
matthiasdilger opened this issue Apr 24, 2024 · 6 comments
Assignees
Labels
needs attention T2.1 teams issue issue that has been reviewed and likely teams specific teams-developer-support

Comments

@matthiasdilger
Copy link

Teams JS lib 2.20.0
Only group chats in New Teams are affected, channels work fine. Both work fine in Classic Teams.

To reproduce:
Create a Teams app with bot and configurable tab in groupchat scope
In the tab add a button that executes dialog.url.open({url:'https://someUrlFromTheManifest.com', size: {height:'medium',width:'medium'}})
Add the tab to a group chat (configurationUrl from manifest gets called, you need to execute pages.config.setConfig() with your tab url)
After configuration is done and your tab has loaded, navigate to the 'chat' tab of the group chat and navigate back to your tab
Press the button and nothing happens.

The web dev console shows the following error which implies that channel logic is called, although we are in a group chat:
Screenshot 2024-04-24 at 09 59 45

Reloading the tab fixes the problem, but navigating to the group chat 'chat' and back to your group chat tab makes the problem re-appear. It seems that this navigation path has its own logic, which fails.
Screenshot 2024-04-24 at 10 02 31

This problem has been present in the dev preview for some time and seems to now have made its way into the production ring.

@Vaibhav-MSFT
Copy link

Hello @matthiasdilger ,
Thanks for reporting your issue. We will test this and update you soon.

@maglims maglims added the teams issue issue that has been reviewed and likely teams specific label Apr 24, 2024
@matthiasdilger
Copy link
Author

Hi @Vaibhav-MSFT, do you have an update?

@Vaibhav-MSFT
Copy link

@matthiasdilger , we are still not able to repro the issue, but will share the updates asap.

@matthiasdilger
Copy link
Author

@Vaibhav-MSFT I have just reproduced the issue on https://teams.microsoft.com/v2/, no dev preview. If you follow the steps there, you should be able to see the issue.

@Vaibhav-MSFT
Copy link

@matthiasdilger , we tried with the code snippet and steps shared but are we are not exactly able to repro the exact issue you are facing. Can you provide us with some more snapshots of the code snippets?

@matthiasdilger
Copy link
Author

Hi @Vaibhav-MSFT the other bits are all standard code, your configuration page (that gets called when you try to add the tab to the group chat) has to set up the tab like this:

microsoftTeams.app.initialize().then(() => {
microsoftTeams.pages.config.registerOnSaveHandler((saveEvent) => {
                const configPromise = microsoftTeams.pages.config.setConfig({
                    websiteUrl: "https://myUrl.com",
                    contentUrl: "https://myUrl.com",
                    removeUrl: "https://myUrl.com/remove",
                    entityId: "test",
                    suggestedDisplayName: "Test"
                });
                configPromise.
                        then((result) => {saveEvent.notifySuccess()}).
                        catch((error) => {saveEvent.notifyFailure("failure message")});
            });
microsoftTeams.pages.config.setValidityState(true);
});

And once the tab has been loaded, the button pressed event needs to execute:

const taskInfo = {
          title: "Do something",
          size: {
              height: 'medium',
              width: 'medium'  
          },
          url: 'https://myUrl.com'
      };

        submitHandler = (result) => {
           console.log(result);
        };
        microsoftTeams.dialog.url.open(taskInfo, submitHandler);

You can reproduce this issue on https://teams.microsoft.com/v2, I'm getting quite a few reports from users already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs attention T2.1 teams issue issue that has been reviewed and likely teams specific teams-developer-support
Projects
None yet
Development

No branches or pull requests

5 participants