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

Wrong context passed to team tab when navigating (latest build bug, 24295.607.3241.5057) #2638

Open
nbelyh opened this issue Nov 21, 2024 · 14 comments
Assignees

Comments

@nbelyh
Copy link

nbelyh commented Nov 21, 2024

If you navigate to a tab using a link from one tab, the latest teams client does not give you the new context.
Teams build numbers:
Screenshot 2024-11-21 153415

Meaning, microsoftTeams.getContext() started returning the context from the previous tab/application.

This break deep link navigation completely, as the tab being loaded gets another tab's context.
This is only happening in the very latest build of teams (see the version numbers above).

Example to be clearer:

Personal App calls
executeDeepLink(...here comes the deep link to some team tab....)

Some Teams tab:
getContext(....) ===> returns now the context for the person tab, not this team tab ?????

If you reload the teams tab, the correct (teams tab) context is passed.

@nbelyh nbelyh changed the title context is not changed in the latest build of teams when navigating to a new tab invalid context passed in the latest build when navigating to a new tab Nov 21, 2024
@nbelyh nbelyh changed the title invalid context passed in the latest build when navigating to a new tab Wrong context passed to team tab when navigating (latest build bug, 24295.607.3241.5057) Nov 21, 2024
@Nivedipa-MSFT Nivedipa-MSFT self-assigned this Nov 22, 2024
@Nivedipa-MSFT
Copy link

@nbelyh - Thank you for your inquiry about your Teams app development issue! To assist you better, could you please share the Teams JS library version you are using?
This information will help us better understand the situation and provide a more accurate response.

@haekalarif
Copy link

I had same issue like him,
The problem is context data in channel tab & personal app are different even thought the structure is same, but the value different, there are some data in channel tab not available in personal tab for example groupId, After user click link then navigate to channel tab then the my app try to get context data in channel tab but the context data is still using from personal tab.

Please suggest advise

@nbelyh
Copy link
Author

nbelyh commented Nov 22, 2024

@Nivedipa-MSFT
We are still on the old teamsjs teams-js 1.12.1 (to be compatible with the spfx)
Trying to migrate to the newer version (spfx supports 2.x now), will post an update here if that helps.

But the thing is, for us the problem only happens with the very last teams client.

@sebiJo
Copy link

sebiJo commented Nov 22, 2024

Same here!
We are on @microsoft/[email protected]
Microsoft Teams version 24295.608.3244.8993.
Client version is 50/24110115713.

Reproduce:

  1. Navigate a deep link from a static personal app to a channel tab app
  2. Observe that context.team == undefined and other information from context is also not up-to-date
import * as microsoftTeams from "@microsoft/teams-js";
let context = await microsoftTeams.app.getContext();
//context.team is undefined

@nbelyh
Copy link
Author

nbelyh commented Nov 22, 2024

For me, the context is not undefined; it is defined, but it is a wrong one (and it is wrong one only in the latest build of teams, and only if you navigate to the app using deep link)

@sebiJo
Copy link

sebiJo commented Nov 22, 2024

For me, the context is not undefined; it is defined, but it is a wrong one (and it is wrong one only in the latest build of teams, and only if you navigate to the app using deep link)

Yes, same here. Context is not undefined but fields in the context are undefined that should be defined actually. Only occurs after using a deeplink.

@Nivedipa-MSFT
Copy link

@nbelyh - We are experiencing some difficulties in reproducing this scenario. Could you please share your minimal code snippet, app manifest, and a repro video? This will help us replicate the issue on our end and, if necessary, raise a bug accordingly.

@nbelyh
Copy link
Author

nbelyh commented Nov 27, 2024

@Nivedipa-MSFT
I will create a test application and attach here. Will take a bit

@NicolasMCAG
Copy link

Hello @Wajeed-msft and @Nivedipa-MSFT

Are there any news about this issue? We are facing this issue as well and we need it solved to be able to publish our app.

We have a configurable tab scoped to teams which we developed with the Teams Toolkit, when the tab is loaded from the Teams UI it works fine (first screenshot), from the app we generate a deep link to the tab and a specific sub entity, and when we open the deep link in the browser we see the described behavior (second screenshot).

Fresh load of the tab:
image

After opening the deep link in the browser:
image

The deep link we generate works perfectly fine on an older version of our tab which was developed only with SPFX.

@nbelyh
Copy link
Author

nbelyh commented Dec 11, 2024

@Nivedipa-MSFT

I have created a demo APP to reproduce the bug. Please find the repository here (teams toolkit minimal template with modifications to reproduce the issue). plain javascript/html, no authentication.
https://github.com/nbelyh/teams-bug-navigation

The package (manifest) is attached here:
appPackage.dev.zip

The video explaining the problem is here (vimeo):
https://vimeo.com/1038227922/bfe2ef1ef7

The code used to navigate (but actually, any navigation method fails the same way, i.e. the old executeDeepLink as well, and navigateToTab as well):

      microsoftTeams.pages.navigateToApp({
        appId,
        pageId,
        channelId,
      })

Please note: reproducible with the latest teams version, mentioned in the issue description (ending with 5507).

Desktop (reproducible): You have Microsoft Teams version 24295.607.3241.5057.
Web (reproducible): The client version is 1415/24110115722.

The problem is, after navigation the context passed to the tab is not the tab's context (i.e. context not changed). Therefore all tab/channel/site specific properties are empty. Please kindly let me know if there is something else I could do to help investigating the issue.

@Nivedipa-MSFT
Copy link

@nbelyh - We have tested this on Desktop Microsoft Teams version 24345.1900.3299.7394 and were unable to reproduce the issue. It is working fine on our end.

Navigation_Bug.mp4

Could you please update your Teams version and check again?

@ingmaramzan
Copy link

ingmaramzan commented Dec 12, 2024

Hi @Nivedipa-MSFT , I am a colleague of @haekalarif,
We are an ISV that developed SaaS solutions for Microsoft Teams. We have developed and published apps that extensively use the Teams Context and we have received messages from several users experiencing this issue with the deeplink.
Not all of our users are experiencing it and it can happen either in Teams Desktop or Teams Web version. I think the issue might be more tenant-related, because we have a test Teams tenant that is affected by the issue but others that don't.

Is there anything we can provide to help the investigation, will sending HAR logs be helpful? If so, we would be happy to help provide the logs from the Teams tenant that has the issue.

@NicolasMCAG
Copy link

@nbelyh - We have tested this on Desktop Microsoft Teams version 24345.1900.3299.7394 and were unable to reproduce the issue. It is working fine on our end.

Navigation_Bug.mp4
Could you please update your Teams version and check again?

Hi @Nivedipa-MSFT,

As I described, the issue also affects manually opening a deep link (for example, if you manually paste the deep link in the browser, or if you have it in another place like a Planner task, adaptive card outside Teams, etc).

Can you validate this scenario as well now that you have a PoC app thanks to nbelyh?

Thanks in advance.

@nbelyh
Copy link
Author

nbelyh commented Dec 12, 2024

@Nivedipa-MSFT
How can I update teams to that version? It says I have the latest version.
Could it be the distribution channel (that is why the issue may be tenant-dependent)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants