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

Vinay/mgt proxy support: Added support for the MGT web proxy #90

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

vinay199129
Copy link
Collaborator

Closes #

PR Type

Description of the changes

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

@vinay199129 vinay199129 marked this pull request as draft June 6, 2024 14:12
Copy link

github-actions bot commented Jun 6, 2024

Code Coverage

Package Line Rate Branch Rate Complexity Health
mgt-chat.src.statefulClient 100% 100% 0
mgt-chat.src.utils 100% 92% 0
mgt-components.dist.es6.components.mgt-agenda.src.components.mgt-agenda 14% 100% 0
mgt-components.dist.es6.components.mgt-contact.src.components.mgt-contact 62% 100% 0
mgt-components.dist.es6.components.mgt-file-list.mgt-file-upload.src.components.mgt-file-list.mgt-file-upload 43% 100% 0
mgt-components.dist.es6.components.mgt-file-list.src.components.mgt-file-list 62% 100% 0
mgt-components.dist.es6.components.mgt-file.src.components.mgt-file 61% 100% 0
mgt-components.dist.es6.components.mgt-get.src.components.mgt-get 19% 100% 0
mgt-components.dist.es6.components.mgt-login.src.components.mgt-login 64% 100% 0
mgt-components.dist.es6.components.mgt-messages.src.components.mgt-messages 66% 100% 0
mgt-components.dist.es6.components.mgt-organization.src.components.mgt-organization 46% 100% 0
mgt-components.dist.es6.components.mgt-people-picker.src.components.mgt-people-picker 56% 100% 0
mgt-components.dist.es6.components.mgt-people.src.components.mgt-people 72% 100% 0
mgt-components.dist.es6.components.mgt-person-card.src.components.mgt-person-card 59% 33% 0
mgt-components.dist.es6.components.mgt-person.src.components.mgt-person 53% 100% 0
mgt-components.dist.es6.components.mgt-picker.src.components.mgt-picker 78% 100% 0
mgt-components.dist.es6.components.mgt-planner.src.components.mgt-planner 55% 100% 0
mgt-components.dist.es6.components.mgt-profile.src.components.mgt-profile 39% 100% 0
mgt-components.dist.es6.components.mgt-search-box.src.components.mgt-search-box 83% 100% 0
mgt-components.dist.es6.components.mgt-search-results.src.components.mgt-search-results 56% 100% 0
mgt-components.dist.es6.components.mgt-tasks-base.src.components.mgt-tasks-base 86% 100% 0
mgt-components.dist.es6.components.mgt-taxonomy-picker.src.components.mgt-taxonomy-picker 74% 100% 0
mgt-components.dist.es6.components.mgt-teams-channel-picker.src.components.mgt-teams-channel-picker 62% 100% 0
mgt-components.dist.es6.components.mgt-theme-toggle.src.components.mgt-theme-toggle 74% 100% 0
mgt-components.dist.es6.components.mgt-todo.src.components.mgt-todo 78% 100% 0
mgt-components.dist.es6.components.src.components 86% 100% 0
mgt-components.dist.es6.components.sub-components.mgt-arrow-options.src.components.sub-components.mgt-arrow-options 76% 100% 0
mgt-components.dist.es6.components.sub-components.mgt-dot-options.src.components.sub-components.mgt-dot-options 29% 100% 0
mgt-components.dist.es6.components.sub-components.mgt-flyout.src.components.sub-components.mgt-flyout 40% 100% 0
mgt-components.dist.es6.components.sub-components.mgt-spinner.src.components.sub-components.mgt-spinner 92% 100% 0
mgt-components.dist.es6.graph.src.graph 36% 100% 0
mgt-components.dist.es6.src 100% 100% 0
mgt-components.dist.es6.styles.src.styles 73% 100% 0
mgt-components.dist.es6.utils.src.utils 46% 100% 0
mgt-components.src.components 84% 75% 0
mgt-components.src.components.mgt-contact 68% 83% 0
mgt-components.src.components.mgt-file 62% 100% 0
mgt-components.src.components.mgt-file-list 46% 100% 0
mgt-components.src.components.mgt-file-list.mgt-file-upload 49% 86% 0
mgt-components.src.components.mgt-get 22% 100% 0
mgt-components.src.components.mgt-messages 68% 100% 0
mgt-components.src.components.mgt-organization 47% 100% 0
mgt-components.src.components.mgt-person 84% 76% 0
mgt-components.src.components.mgt-person-card 67% 48% 0
mgt-components.src.components.mgt-picker 80% 100% 0
mgt-components.src.components.mgt-profile 40% 100% 0
mgt-components.src.components.mgt-tasks-base 87% 100% 0
mgt-components.src.components.mgt-theme-toggle 100% 100% 0
mgt-components.src.components.mgt-todo 79% 100% 0
mgt-components.src.components.sub-components.mgt-flyout 72% 53% 0
mgt-components.src.components.sub-components.mgt-spinner 100% 100% 0
mgt-components.src.graph 40% 73% 0
mgt-components.src.styles 92% 80% 0
mgt-components.src.utils 82% 46% 0
mgt-element.dist.es6.components.src.components 72% 74% 0
mgt-element.dist.es6.mock.src.mock 91% 77% 0
mgt-element.dist.es6.providers.src.providers 87% 83% 0
mgt-element.dist.es6.src 91% 80% 0
mgt-element.dist.es6.utils.src.utils 67% 73% 0
mgt-element.src 93% 40% 0
mgt-element.src.components 78% 100% 0
mgt-element.src.mock 81% 56% 0
mgt-element.src.providers 84% 91% 0
mgt-element.src.utils 71% 90% 0
Summary 60% (28097 / 46619) 71% (564 / 796) 0

@vinay199129 vinay199129 changed the base branch from main to next/mgt-chat June 6, 2024 14:16
@vinay199129 vinay199129 marked this pull request as ready for review June 6, 2024 14:17
@MattBillFred
Copy link
Collaborator

A new subscription is being created right after renewing the previous one

When looking at the network log, I'm seeing a subscriptions POST happening immediately after the previous subscription is successfully PATCHed:
firefox_A85myFKKzQ

I validated that neither the prior version of MGT, nor the isWebProxyEnabled: false configuration, has this behavior.

@MattBillFred
Copy link
Collaborator

The subscription renewal process will fail after running for over an hour

At some point after running the chat list for an extended period of time, subscription renewals will fail with the following error:

error: invalid_grant
error_description: AADSTS500133: Assertion is not within its valid time range. Ensure that the access token is not expired before using it for user assertion, or request a new token. Current time: 2024-06-06T21:14:53.3917103Z, expiry time of assertion 2024-06-06T21:13:51.0000000Z.

Here are some examples:

Initial grant:       Thu, 06 Jun 2024 20:00:21 GMT
Most recent success: Thu, 06 Jun 2024 21:06:11 GMT
Failure:             Thu, 06 Jun 2024 21:14:53 GMT

Initial grant:       Fri, 07 Jun 2024 19:23:10 GMT
Most recent success: Fri, 07 Jun 2024 20:43:03 GMT
Failure:             Fri, 07 Jun 2024 20:51:43 GMT

I validated that this does not happen in the prior version of MGT. I did not test the isWebProxyEnabled: false configuration.

@MattBillFred
Copy link
Collaborator

MGT gets stuck in continuous POST loop until it uses up all the subscriptions

This is likely a problem due to me switching between versions of MGT while testing.

I initially see this error in the console:

Error: Failed to create a new subscription due to a transient condition; retrying in 3 seconds: Cannot read properties of undefined (reading 'findIndex')

This will trigger a new subscription request, which will eventually lead to the following error:

Operation: Create; Exception: [Status Code: Forbidden; Reason: User 'guid' has reached its limit of '10' 'USERS/GUID/CHATS/GETALLMESSAGES' subscription on tenant 'guid'.

The error is initially being thrown on this line in ProxySubscriptionCache.ts:

const subIndex = cacheEntry.proxySubscriptions.findIndex(

It appears that the cached entry being pulled from the store does not have proxySubscriptions defined. I'm guessing it is a value that was cached when I was running the prior version of MGT.

@plasne plasne merged commit 258dc70 into next/mgt-chat Jun 8, 2024
6 checks passed
@plasne plasne deleted the vinay/mgt-proxy-support branch June 8, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants