From 1e78db9bfabf5bd4feb4404990437364faa83517 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Wed, 27 Aug 2025 17:58:24 +0200 Subject: [PATCH] frontend: remove cached webhookPreferences property and add parameter to force refreshing security preferences --- .../services/global-preferences.service.ts | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/frontend/projects/shared-meet-components/src/lib/services/global-preferences.service.ts b/frontend/projects/shared-meet-components/src/lib/services/global-preferences.service.ts index 9b20293..d7e29f5 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/global-preferences.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/global-preferences.service.ts @@ -10,7 +10,6 @@ export class GlobalPreferencesService { protected readonly PREFERENCES_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/preferences`; protected securityPreferences?: SecurityPreferences; - protected webhookPreferences?: WebhookPreferences; protected log; @@ -21,8 +20,8 @@ export class GlobalPreferencesService { this.log = this.loggerService.get('OpenVidu Meet - GlobalPreferencesService'); } - async getSecurityPreferences(): Promise { - if (this.securityPreferences) { + async getSecurityPreferences(forceRefresh = false): Promise { + if (this.securityPreferences && !forceRefresh) { return this.securityPreferences; } @@ -48,14 +47,9 @@ export class GlobalPreferencesService { } async getWebhookPreferences(): Promise { - if (this.webhookPreferences) { - return this.webhookPreferences; - } - try { const path = `${this.PREFERENCES_API}/webhooks`; - this.webhookPreferences = await this.httpService.getRequest(path); - return this.webhookPreferences; + return await this.httpService.getRequest(path); } catch (error) { this.log.e('Error fetching webhook preferences:', error); throw error; @@ -65,14 +59,6 @@ export class GlobalPreferencesService { async saveWebhookPreferences(preferences: WebhookPreferences) { const path = `${this.PREFERENCES_API}/webhooks`; await this.httpService.putRequest(path, preferences); - - // Only update fields that are explicitly provided - if (this.webhookPreferences) { - this.webhookPreferences.enabled = preferences.enabled; - if (preferences.url) { - this.webhookPreferences.url = preferences.url; - } - } } async testWebhookUrl(url: string): Promise {