Commit 9951253
authored
fix(sagemaker): Use SpaceSettingsSummary.AppType instead of App.AppType (#8276)
## Problem
- Fixes crash when connecting to spaces that have been stopped for long
- The code was incorrectly accessing node.spaceApp.App.AppType, but the
App object is undefined for spaces stopped for long as it deletes the
App resource . This caused below error
```
Error running command aws.smus.openRemoteConnection: Remote connection failed: Cannot read properties of undefined (reading 'AppType'). This is likely caused by the extension that contributes aws.smus.openRemoteConnection.
```
## Solution
Changed to use node.spaceApp.SpaceSettingsSummary.AppType instead, which
-
- Is always available (part of space configuration, not runtime state)
- Contains the correct AppType value needed for start/stop operations
- SpaceSettingsSummary comes from ListSpaces API call and it will always
returns SpaceSettingsSummary as part of the SpaceDetails.
- AppType is a required field in SpaceSettingsSummary because every
SageMaker space must have an application type (JupyterLab or
CodeEditor).
---
- 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 5b2bc07 commit 9951253
File tree
2 files changed
+13
-4
lines changed- packages/core/src
- awsService/sagemaker
- test/awsService/sagemaker
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
372 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
373 | 381 | | |
374 | 382 | | |
375 | 383 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
0 commit comments