Skip to content

Commit f2eabbd

Browse files
authored
fix(resourceCache): cache not used by 2nd vscode instance
## Problem commit 97a4482 breaks the cache by resetting the flag/lock on connection changed. When users sign in and have multiple VSCode instances, all windows will get a `onConnectionChanged` hence overwrite the lock/flag and load the resource from live. ## Solution Only clear the cache when users sign out, and it's sufficient for "change connection" use case as well. (users have to sign out before connecting with different connection)
1 parent 3549e33 commit f2eabbd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/core/src/codewhisperer/util/authUtil.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ export class AuthUtil {
143143

144144
if (!this.isConnected()) {
145145
await this.regionProfileManager.invalidateProfile(this.regionProfileManager.activeRegionProfile?.arn)
146+
await this.regionProfileManager.clearCache()
146147
}
147-
148-
await this.regionProfileManager.clearCache()
149148
})
150149

151150
this.regionProfileManager.onDidChangeRegionProfile(async () => {

0 commit comments

Comments
 (0)