Отключить телеметрию PnP: необработанный отказ промиса в мониторинге
Tests / frontend-test (pull_request) Successful in 4m30s
Tests / frontend-test (pull_request) Successful in 4m30s
@pnp/spfx-controls-react через @pnp/telemetry-js шлёт fetch на pnptelemetryproxy.azurewebsites.net без catch. Где адрес закрыт прокси или блокировщиком, каждый раз «Failed to fetch» и «Необработанный отказ промиса» в логах request-portal. Отключаем её в onInit (optOut), @pnp/telemetry-js — прямой зависимостью той же версии 2.0.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Generated
+1
@@ -17,6 +17,7 @@
|
||||
"@microsoft/sp-webpart-base": "1.22.1",
|
||||
"@pnp/sp": "^4.20.0",
|
||||
"@pnp/spfx-controls-react": "^3.25.0",
|
||||
"@pnp/telemetry-js": "2.0.0",
|
||||
"@tnsu/monitoring-web": "^0.3.4",
|
||||
"@tnsu/ui-kit": "^0.15.0",
|
||||
"jszip": "~3.8.0",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"@microsoft/sp-webpart-base": "1.22.1",
|
||||
"@pnp/sp": "^4.20.0",
|
||||
"@pnp/spfx-controls-react": "^3.25.0",
|
||||
"@pnp/telemetry-js": "2.0.0",
|
||||
"@tnsu/monitoring-web": "^0.3.4",
|
||||
"@tnsu/ui-kit": "^0.15.0",
|
||||
"jszip": "~3.8.0",
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from '@microsoft/sp-property-pane';
|
||||
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
|
||||
import { IReadonlyTheme } from '@microsoft/sp-component-base';
|
||||
import PnPTelemetry from '@pnp/telemetry-js';
|
||||
import { initMonitoring, spfxTokenProvider } from '@tnsu/monitoring-web';
|
||||
|
||||
import * as strings from 'RequestPortalWebPartStrings';
|
||||
@@ -104,6 +105,9 @@ export default class RequestPortalWebPart extends BaseClientSideWebPart<IRequest
|
||||
// Один на страницу: повторный вызов (несколько веб-частей) библиотека игнорирует сама.
|
||||
initMonitoring({ service: 'request-portal', getAccessToken: spfxTokenProvider(this.context.aadTokenProviderFactory) });
|
||||
installErrorLogging(); // до всего остального — чтобы поймать и ранние отклонения
|
||||
// Телеметрия PnP (её включает @pnp/spfx-controls-react) шлёт fetch на pnptelemetryproxy.azurewebsites.net
|
||||
// без catch: где адрес закрыт прокси или блокировщиком, это необработанный отказ промиса в мониторинге.
|
||||
PnPTelemetry.getInstance().optOut();
|
||||
initSP(this.context); // единый клиент PnPjs для записи в списки
|
||||
|
||||
// Адрес approval-route должен быть выставлен ДО загрузки партиций — они
|
||||
|
||||
Reference in New Issue
Block a user