diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 7b3fe260d7..902d2a0921 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -108,7 +108,7 @@ import SoftLogout from './auth/SoftLogout'; import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; -import { initSentry, sendSentryReport } from "../../sentry"; +import { initSentry } from "../../sentry"; /** constants for MatrixChat.state.view */ export enum Views { diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index a1b67cb347..926d3da30c 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -71,7 +71,7 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> { private onBugReport = (): void => { Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { label: 'react-soft-crash', - error: this.state.error + error: this.state.error, }); }; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 884d004551..1bf65bf202 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -451,6 +451,8 @@ export default class EventTile extends React.Component { client.on("Room.receipt", this.onRoomReceipt); this.isListeningForReceipts = true; } + + throw new Error("oops"); } // TODO: [REACT-WARNING] Replace with appropriate lifecycle event diff --git a/src/sentry.ts b/src/sentry.ts index 94ee86838c..3cded20a83 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -21,7 +21,7 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; import { MatrixClient } from "../../matrix-js-sdk"; -async function getStorageOptions(): Record { +async function getStorageOptions(): Promise> { const result = {}; // add storage persistence/quota information @@ -65,7 +65,7 @@ function getEnabledLabs(): string { } } -async function getCryptoContext(client: MatrixClient): Record { +async function getCryptoContext(client: MatrixClient): Promise> { if (!client.isCryptoEnabled()) { return {}; } @@ -98,7 +98,7 @@ async function getCryptoContext(client: MatrixClient): Record { }; } -function getDeviceContext(client: MatrixClient): Record { +function getDeviceContext(client: MatrixClient): Record { const result = { "device_id": client?.deviceId, "mx_local_settings": localStorage.getItem('mx_local_settings'), @@ -114,7 +114,7 @@ function getDeviceContext(client: MatrixClient): Record { return result; } -async function getContexts() { +async function getContexts(): Promise> { const client = MatrixClientPeg.get(); return { "user": getUserContext(client), @@ -124,7 +124,7 @@ async function getContexts() { }; } -export async function sendSentryReport(userText: string, issueUrl: string, error: Error): void { +export async function sendSentryReport(userText: string, issueUrl: string, error: Error): Promise { const sentryConfig = SdkConfig.get()["sentry"]; if (!sentryConfig) return;