Commit 2f39da8
authored
fix(toolkit): handle isCn when region is not initialized to fix extension activation failure (aws#7599)
## Problem
With updating Toolkit version to latest in SMUS CodeEditor Spaces,
observing Toolkit throws an error as attached in screenshot below with
error message
```
Attempted to get compute region without initializing
```
<img width="2039" alt="image"
src="https://github.com/user-attachments/assets/a53e8fdc-bf7b-4c96-98fa-78c6db819a72"
/>
## Solution
- Issue is due to getComputeRegion() invoked first before compute region
is initialized
- hence solution is to Make `isCn()` resilient to uninitialized state
and return a default value
- Tested with a local debug artifact in SMUS CodeEditor space, toolkit
activation completed and working
-
<img width="1886" alt="image"
src="https://github.com/user-attachments/assets/988c208c-3fe8-4530-a477-3e8704f1f598"
/>
- Also Tested the changes in standalone VS code application and SMAI
compute instance, and toolkit explorer view is seen working as expected
-

-

- Also tested the vsix in china region cn-north-1, and working as
expected
-
<img width="720" height="393" alt="image"
src="https://github.com/user-attachments/assets/b0523567-82ad-4dcb-b218-a935983c3b47"
/>
---
- 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 9cf9bdd commit 2f39da8
File tree
2 files changed
+79
-2
lines changed- packages/core/src
2 files changed
+79
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
138 | 205 | | |
139 | 206 | | |
140 | 207 | | |
| |||
0 commit comments