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

Many of the samples do not properly wait for the initialize() function in teams-js to complete #988

Closed
AE-MS opened this issue Oct 8, 2023 · 5 comments
Assignees
Labels
needs-attention pr-raised Pull Request raised for updating the code.

Comments

@AE-MS
Copy link

AE-MS commented Oct 8, 2023

If you look through these search results:
https://github.com/search?q=repo%3AOfficeDev%2FMicrosoft-Teams-Samples+microsoftTeams.app.initialize%28%29%3B&type=code

You will see many places where microsoftTeams.app.initialize() is called but either not awaited or followed by .then()

Per the documentation for app.initialize(), the call must complete before any other teams-js calls are made to avoid race conditions.

It's hard to know by just looking at the search results how many of them are bugs (theoretically calling app.initialize() without waiting for it to finish is only a bug if you aren't calling any other teams-js functions after), but it would appear that many of them are (e.g., app-in-meeting.jsx calls initialize and then immediately calls getContext, and searchSettings.html calls initialize and doesn't verify it's complete before potentially calling authentication.notifySuccess)

@microsoft-github-policy-service

Hi @AE-MS! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@Meghana-MSFT
Copy link
Collaborator

Thank you for reporting this, we will share this with sample team and get these updated.

@ChetanSharma-msft
Copy link
Collaborator

ChetanSharma-msft commented Oct 31, 2023

Hello @AE-MS - We have done the changes and raised the PR for it: #1008

Could you please verify the PR and let us know if any other changes required.

@Meghana-MSFT
Copy link
Collaborator

Meghana-MSFT commented Nov 16, 2023

#1008 has been raised for this issue.

PR is merged now, so we are closing this issue.

Tell us about your experience!

Hi @AE-MS! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards,
Teams Platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-attention pr-raised Pull Request raised for updating the code.
Projects
None yet
Development

No branches or pull requests

6 participants