@@ -39,7 +39,7 @@ import * as beta from './dev/beta'
3939import { activate as activateApplicationComposer } from './applicationcomposer/activation'
4040import { activate as activateRedshift } from './awsService/redshift/activation'
4141import { activate as activateIamPolicyChecks } from './awsService/accessanalyzer/activation'
42- import { activate as activateNotifications } from './notifications/activation'
42+ import { activate as activateNotifications , deactivate as deactivateNotifications } from './notifications/activation'
4343import { SchemaService } from './shared/schemas'
4444import { AwsResourceManager } from './dynamicResources/awsResourceManager'
4545import globals from './shared/extensionGlobals'
@@ -60,6 +60,7 @@ import { activate as activateThreatComposerEditor } from './threatComposer/activ
6060import { isSsoConnection , hasScopes } from './auth/connection'
6161import { CrashMonitoring , setContext } from './shared'
6262import { AuthFormId } from './login/webview/vue/types'
63+ import { RemoteFetcher } from './notifications/controller'
6364
6465let localize : nls . LocalizeFunc
6566
@@ -246,7 +247,10 @@ export async function activate(context: vscode.ExtensionContext) {
246247 ...authState ,
247248 } )
248249
249- await activateNotifications ( context , authState , getAuthState )
250+ await activateNotifications ( context , authState , getAuthState , {
251+ fetcher : new RemoteFetcher ( ) ,
252+ storageKey : 'aws.notifications' ,
253+ } )
250254 } catch ( error ) {
251255 const stacktrace = ( error as Error ) . stack ?. split ( '\n' )
252256 // truncate if the stacktrace is unusually long
@@ -270,6 +274,7 @@ export async function deactivate() {
270274 // Run concurrently to speed up execution. stop() does not throw so it is safe
271275 await Promise . all ( [ await ( await CrashMonitoring . instance ( ) ) ?. shutdown ( ) , deactivateCommon ( ) , deactivateEc2 ( ) ] )
272276 await globals . resourceManager . dispose ( )
277+ deactivateNotifications ( )
273278}
274279
275280async function handleAmazonQInstall ( ) {
@@ -338,7 +343,7 @@ function recordToolkitInitialization(activationStartedOn: number, settingsValid:
338343 }
339344}
340345
341- async function getAuthState ( ) : Promise < Omit < AuthUserState , 'source' > > {
346+ export async function getAuthState ( ) : Promise < Omit < AuthUserState , 'source' > > {
342347 let authStatus : AuthStatus = 'notConnected'
343348 const enabledConnections : Set < AuthFormId > = new Set ( )
344349 const enabledScopes : Set < string > = new Set ( )
0 commit comments