Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
if (connection) {
try {
await smusAuthProvider.reauthenticate(connection)
const projectNode = smusRootNode.getProjectSelectNode()
const project = projectNode.getProject()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you close IDE, return to a state requiring re-auth, does the project node still exist in memory? Can you test? I would think not and won't that cause a NPE or is that somehow handled? If yes, please explain how.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project node is always there. I have tested

  • root node is created in activate() link
  • Project node is created in root node constructor link

if (!project) {
await vscode.commands.executeCommand('aws.smus.switchProject')
}
treeDataProvider.refresh()

// IAM connections handle their own success messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ describe('SMUS Explorer Activation', function () {

mockSmusRootNode = {
getChildren: sinon.stub().resolves([]),
getProjectSelectNode: sinon.stub().returns({ refreshNode: sinon.stub().resolves() }),
getProjectSelectNode: sinon.stub().returns({
getProject: sinon.stub().returns({ id: 'test-project', name: 'Test Project' }),
refreshNode: sinon.stub().resolves(),
}),
} as any

// Stub vscode APIs
Expand Down
Loading