Commit e411922
authored
fix(amazonq): Handle developer profile migration more gracefully (aws#7362)
## Problem
The cached/persisted Q Developer Profile selection is stored as a map of
`{connectionID: RegionProfile}`, where `connectionID` is a `randomUUID`.
When migrating to Flare auth, we move away from the concept of a
connectionID, and we do not have access to the latest ID of a user. The
result is that we cannot restore the user's last selected region
profile, and always need users who update versions to make a profile
selection.
## Solution
To handle this more gracefully, we will:
* Use regionProfile if matching auth profile name (existing logic)
* If no match, check if there is only a single RegionProfile stored in
lastUsed. If so, use that one
* If no match, and multiple RegionProfiles are stored in lastUsed cache,
make user select
Unit tests added
---
- 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.1 parent 5ff4c32 commit e411922
File tree
2 files changed
+74
-16
lines changed- packages
- amazonq/test/unit/codewhisperer/region
- core/src/codewhisperer/region
2 files changed
+74
-16
lines changedLines changed: 52 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
180 | 182 | | |
181 | | - | |
182 | | - | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 186 | + | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
197 | 242 | | |
198 | 243 | | |
199 | 244 | | |
| |||
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
| |||
319 | 332 | | |
320 | 333 | | |
321 | 334 | | |
322 | | - | |
323 | | - | |
| 335 | + | |
| 336 | + | |
324 | 337 | | |
325 | 338 | | |
326 | 339 | | |
| |||
330 | 343 | | |
331 | 344 | | |
332 | 345 | | |
333 | | - | |
| 346 | + | |
334 | 347 | | |
335 | 348 | | |
336 | 349 | | |
| |||
379 | 392 | | |
380 | 393 | | |
381 | 394 | | |
382 | | - | |
| 395 | + | |
383 | 396 | | |
384 | 397 | | |
385 | 398 | | |
| |||
0 commit comments