feat(chat): correctly pick platform for chat in multi-account setup
Description
feat(chat): show chat only when it can be used ... (!1333 - merged) introduced the mechanism to allow access to Duo Chat only if the connected account can actually use chat.
The problem was that in a scenario when multiple accounts were added to the extension, picking the platform to check for chat support was too trivial - we returned the platform for the first account only.
This MR introduces a more advanced platform selection mechanism to allow accessing chat if at least one connected account has access to Duo Chat no matter whether that account is added first or not.
Related Issues
Resolves gitlab#432958 (closed)
How has this been tested?
Since Web IDE is always a single-account environment and there is no issue with determining the access rights to Duo Chat, this MR has been tested in VSCode desktop only.
Screenshots (if appropriate):
In the screenshots below, the doe
account is the local GDK account without access to chat. dmishunov
is the gitlab.com account with access to Duo Chat.
Before | After |
---|---|
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap