You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
aws#6594
The `getMfaCodeFromUser` currently uses a deprecated version of
`createInputBox` and the following `promptUser` function:
https://github.com/aws/aws-toolkit-vscode/blob/0fa1b5b47ab642458df934192832a4ffcb6c9d1e/packages/core/src/shared/ui/input.ts#L72-L135
Based on the stack trace, there is a race condition here that can lead
to a type error, but unsure how?
Stack trace:
```
TypeError: inputBox.hide is not a function
at promptUser (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/shared/ui/input.ts:133:18)
at async getMfaTokenFromUser (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/auth/credentials/utils.ts:124:19)
at async /Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/auth/providers/sharedCredentialsProvider.ts:422:38
```
### Investigation Notes:
- The error only happens when running the test suite as a whole.
- The error only happens in CI (unable to reproduce locally).
## Solution
- avoid use of deprecated `createInputBox`
[function](https://github.com/aws/aws-toolkit-vscode/blob/0fa1b5b47ab642458df934192832a4ffcb6c9d1e/packages/core/src/shared/ui/input.ts#L31-L58),
prefer new version instead.
- Ran the tests 4x with 1000x on the test, and did not see a failure.
## Future Work
- Migrate existing cases away from this deprecated `createInputBox` if
there is evidence it leads to flaky tests or unreliable behavior.
0 commit comments