Repository: microsoftgraph/microsoft-graph-explorer-v4 (ts)

Issue:
Fix the errors thrown by the Resizable package
**Describe the bug**
Resizable is throwing loop limit errors every time a handle is resized. The errors are clogging our error reporting in a way that makes it difficult to discover relevant errors that we could be having.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to https://developer.microsoft.com/en-us/graph/graph-explorer
2. Click on any resize handler and resize it
3. Open the the network tab on DevTools
4. See error (ResizeObserver error)

**Expected behavior**
The ResizeObserver loop limit error should not get to App Insights.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


Pull request description:
Fix: Add method to filter ResizeObserver exceptions
## Overview

Closes #2303 

### Demo

Optional. Screenshots, `curl` examples, etc.

### Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

## Testing Instructions

* Checkout to this branch.
* Run local instance of GE.
* Navigate to the first track request under the Network tab.
* Observe absence of telemetry captured in the image below

![image](https://user-images.githubusercontent.com/34104277/212099256-ea40cb5e-d8aa-48ca-9db6-0bd938388421.png)


Patch:
diff --git a/src/telemetry/filters.ts b/src/telemetry/filters.ts
index 1104f31b..fd792fdb 100644
--- a/src/telemetry/filters.ts
+++ b/src/telemetry/filters.ts
@@ -89,3 +89,9 @@ export function sanitizeTelemetryItemUriProperty(envelope: ITelemetryItem) {
   }
   return true;
 }
+
+export function filterResizeObserverExceptions(envelope: ITelemetryItem){
+  if (envelope.data?.message === 'ErrorEvent: ResizeObserver loop limit exceeded') {
+    return false;
+  }
+}
\ No newline at end of file
diff --git a/src/telemetry/telemetry.ts b/src/telemetry/telemetry.ts
index a537f2a9..8ba22413 100644
--- a/src/telemetry/telemetry.ts
+++ b/src/telemetry/telemetry.ts
@@ -23,7 +23,8 @@ import {
   addCommonTelemetryItemProperties,
   filterRemoteDependencyData,
   filterTelemetryTypes,
-  sanitizeTelemetryItemUriProperty
+  sanitizeTelemetryItemUriProperty,
+  filterResizeObserverExceptions
 } from './filters';
 import ITelemetry from './ITelemetry';
 import { getVersion } from '../app/utils/version';
@@ -57,6 +58,7 @@ class Telemetry implements ITelemetry {
   public initialize() {
     this.appInsights.loadAppInsights();
     this.appInsights.trackPageView();
+    this.appInsights.addTelemetryInitializer(filterResizeObserverExceptions);
     this.appInsights.addTelemetryInitializer(filterTelemetryTypes);
     this.appInsights.addTelemetryInitializer(filterRemoteDependencyData);
     this.appInsights.addTelemetryInitializer(sanitizeTelemetryItemUriProperty);


Test patch:
diff --git a/src/tests/telemetry/filters.spec.ts b/src/tests/telemetry/filters.spec.ts
index 1d173921..e34b3224 100644
--- a/src/tests/telemetry/filters.spec.ts
+++ b/src/tests/telemetry/filters.spec.ts
@@ -3,7 +3,8 @@ import {
   filterTelemetryTypes,
   filterRemoteDependencyData,
   addCommonTelemetryItemProperties,
-  sanitizeTelemetryItemUriProperty
+  sanitizeTelemetryItemUriProperty,
+  filterResizeObserverExceptions
 } from '../../../src/telemetry/filters';
 
 describe('Telemetry filters should', () => {
@@ -56,7 +57,7 @@ describe('Telemetry filters should', () => {
 
     // Assert
     expect(result).toBe(true);
-  })
+  });
 
   it('sanitize telemetry item uri property', () => {
     // Arrange
@@ -76,5 +77,25 @@ describe('Telemetry filters should', () => {
 
     // Assert
     expect(result).toBe(true);
-  })
+  });
+
+  it('remove telemetry with ResizeObserver loop limit error when filterResizeObserverExceptions() is called', () => {
+    // Arrange
+    const envelope: ITelemetryItem = {
+      ver: '1.0',
+      name: 'test',
+      time: '',
+      iKey: '',
+      baseType: 'ErrorData',
+      data: {
+        message: 'ErrorEvent: ResizeObserver loop limit exceeded'
+      }
+    }
+
+    // Act
+    const result = filterResizeObserverExceptions(envelope);
+
+    // Assert
+    expect(result).toBe(false);
+  });
 })