Commit d2f6b9a
authored
fix(chat): Resend auth token on server restart (#7156)
## Problem:
When the server restarted due to a crash, the auth token was not sent
again. This caused users to run in to the state where if it crashed and
restarted, when they sent a subsequent chat message they'd get stuck
with the server asking the user to Authenticate.
Note that server restart is triggered automatically by the
LanguageClient, I think.
## Solution:
Detect when the server is restarted and manually resend the bearer token
again.
Note, this solution needs to be revisited since there may be other
initialization logic that needs to run on server restart, aside from
just the bearer token.
## Repro Steps:
1. Ensure you do not have a workspace open, you can open a new vscode
window at the top left `File` > `New Window`
2. Make a random folder in your home directory
3. Make a couple typescript files in that folder
4. Send the prompt: `list all files in {folder}`
5. Accept the permissions
6. Click the toggle drop down from the response, and click the link to
the path (this is just to force a crash + restart)
7. Verify the server crashed in the logs, look for the message
`Connection to server got closed. Server will restart.`
8. ASSUMING this fix worked, the server will restart automatically and
you can continue using chat. Before this fix any subsequent messages
would ask the user to `Authenticate` again
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Signed-off-by: nkomonen-amazon <[email protected]>1 parent dc849e7 commit d2f6b9a
2 files changed
+25
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
0 commit comments