From 24f7e6b5f8c0ebd876bea45a8da028cbeb9bbdb8 Mon Sep 17 00:00:00 2001 From: nick-w-nick <43578531+nick-w-nick@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:45:48 -0400 Subject: [PATCH 1/5] added databaseMirroringPartner event emitter --- src/connection.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/connection.ts b/src/connection.ts index d810acb16..3c03dd537 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -1920,6 +1920,10 @@ class Connection extends EventEmitter { * @private */ emit(event: 'databaseChange', databaseName: string): boolean + /** + * @private + */ + emit(event: 'databaseMirroringPartner', partnerInstanceName: string): boolean /** * @private */ From 4891a41978e1e93f567a46fb70ec28b11378d97f Mon Sep 17 00:00:00 2001 From: nick-w-nick <43578531+nick-w-nick@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:46:50 -0400 Subject: [PATCH 2/5] added onDatabaseMirroringPartner handler methods --- src/token/handler.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/token/handler.ts b/src/token/handler.ts index 0c259a723..b7893388a 100644 --- a/src/token/handler.ts +++ b/src/token/handler.ts @@ -166,6 +166,10 @@ export class InitialSqlTokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } + onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { + this.connection.emit('databaseMirroringPartner', token.newValue); + } + onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } @@ -284,6 +288,10 @@ export class Login7TokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } + onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { + this.connection.emit('databaseMirroringPartner', token.newValue); + } + onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } @@ -355,10 +363,6 @@ export class Login7TokenHandler extends TokenHandler { onPacketSizeChange(token: PacketSizeEnvChangeToken) { this.connection.messageIo.packetSize(token.newValue); } - - onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { - // Do nothing - } } /** @@ -406,6 +410,10 @@ export class RequestTokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } + onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { + this.connection.emit('databaseMirroringPartner', token.newValue); + } + onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } From 5b6e12d0d27f183780c9ed12f8f70ace4daf46b2 Mon Sep 17 00:00:00 2001 From: nick-w-nick <43578531+nick-w-nick@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:09:51 -0400 Subject: [PATCH 3/5] removed unnecessary database mirroring event handlers --- src/token/handler.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/token/handler.ts b/src/token/handler.ts index b7893388a..0f372ebfc 100644 --- a/src/token/handler.ts +++ b/src/token/handler.ts @@ -166,10 +166,6 @@ export class InitialSqlTokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } - onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { - this.connection.emit('databaseMirroringPartner', token.newValue); - } - onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } @@ -288,10 +284,6 @@ export class Login7TokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } - onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { - this.connection.emit('databaseMirroringPartner', token.newValue); - } - onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } From f209f0e4d021b902665e957c582249fbfbf41eba Mon Sep 17 00:00:00 2001 From: nick-w-nick <43578531+nick-w-nick@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:12:50 -0400 Subject: [PATCH 4/5] re-added database mirroring handler for login7tokenhandler --- src/token/handler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/token/handler.ts b/src/token/handler.ts index 0f372ebfc..f3dd52104 100644 --- a/src/token/handler.ts +++ b/src/token/handler.ts @@ -284,6 +284,10 @@ export class Login7TokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } + onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { + this.connection.emit('databaseMirroringPartner', token.newValue); + } + onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); } From 0c03b3003013c2a612a787a5d060b4997abab63d Mon Sep 17 00:00:00 2001 From: nick-w-nick <43578531+nick-w-nick@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:10:21 -0500 Subject: [PATCH 5/5] removed database mirroring partner event from generic request token handler --- src/token/handler.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/token/handler.ts b/src/token/handler.ts index f3dd52104..4d73c06be 100644 --- a/src/token/handler.ts +++ b/src/token/handler.ts @@ -406,10 +406,6 @@ export class RequestTokenHandler extends TokenHandler { this.connection.emit('databaseChange', token.newValue); } - onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) { - this.connection.emit('databaseMirroringPartner', token.newValue); - } - onLanguageChange(token: LanguageEnvChangeToken) { this.connection.emit('languageChange', token.newValue); }