From 86f3a367d9e7025495442514da4bdc5c332b90e8 Mon Sep 17 00:00:00 2001 From: VitoAlbano Date: Wed, 27 Nov 2024 14:11:38 +0000 Subject: [PATCH] Maybe --- .../src/lib/services/web-socket.service.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/process-services-cloud/src/lib/services/web-socket.service.ts b/lib/process-services-cloud/src/lib/services/web-socket.service.ts index 2cb86b1120..a49f2212de 100644 --- a/lib/process-services-cloud/src/lib/services/web-socket.service.ts +++ b/lib/process-services-cloud/src/lib/services/web-socket.service.ts @@ -40,6 +40,8 @@ import { RetryLink } from '@apollo/client/link/retry'; import { Observable } from 'rxjs'; import { switchMap, take, tap } from 'rxjs/operators'; import { FeaturesServiceToken, IFeaturesService } from '@alfresco/adf-core/feature-flags'; +import { BaseCloudService } from './base-cloud.service'; +import { AdfHttpClient } from '@alfresco/adf-core/api'; interface serviceOptions { apolloClientName: string; @@ -51,7 +53,7 @@ interface serviceOptions { @Injectable({ providedIn: 'root' }) -export class WebSocketService { +export class WebSocketService extends BaseCloudService { private host = ''; private subscriptionProtocol: 'graphql-ws' | 'transport-ws' = 'transport-ws'; private wsLink: GraphQLWsLink | WebSocketLink; @@ -59,12 +61,13 @@ export class WebSocketService { constructor( private readonly apollo: Apollo, - private readonly appConfigService: AppConfigService, private readonly authService: AuthenticationService, @Inject(FeaturesServiceToken) private featuresService: IFeaturesService, + adfHttpClient: AdfHttpClient, private logger: LogService ) { - this.host = this.appConfigService.get('bpmHost', ''); + super(adfHttpClient); + this.host = this.contextRoot; } public getSubscription(options: serviceOptions): Observable> { @@ -96,8 +99,8 @@ export class WebSocketService { url.protocol = protocol2; const protocol = this.host.split('://')[0] === 'https' ? 'wss' : 'ws'; const subHost = this.host.split('://')[1]; - const finalUrl = `${protocol}://${subHost}/${apolloClientName}/notifications/ws/graphql`; - this.logger.info(`WebSocketService: createWsUrl: ${finalUrl}`); + const finalUrl = `${protocol}://${subHost}/${apolloClientName}/notifications`; + this.logger.error(`WebSocketService: createWsUrl: ${finalUrl}`); return finalUrl; }