Remove test error on startup, and send correct user text
parent
ba1618812c
commit
cc9ddb351f
|
@ -108,7 +108,7 @@ import SoftLogout from './auth/SoftLogout';
|
||||||
import { makeRoomPermalink } from "../../utils/permalinks/Permalinks";
|
import { makeRoomPermalink } from "../../utils/permalinks/Permalinks";
|
||||||
import { copyPlaintext } from "../../utils/strings";
|
import { copyPlaintext } from "../../utils/strings";
|
||||||
import { PosthogAnalytics } from '../../PosthogAnalytics';
|
import { PosthogAnalytics } from '../../PosthogAnalytics';
|
||||||
import {initSentry, sendSentryReport} from "../../sentry";
|
import { initSentry, sendSentryReport } from "../../sentry";
|
||||||
|
|
||||||
/** constants for MatrixChat.state.view */
|
/** constants for MatrixChat.state.view */
|
||||||
export enum Views {
|
export enum Views {
|
||||||
|
@ -396,14 +396,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
CountlyAnalytics.instance.enable(/* anonymous = */ true);
|
CountlyAnalytics.instance.enable(/* anonymous = */ true);
|
||||||
|
|
||||||
initSentry(SdkConfig.get()["sentry"]);
|
initSentry(SdkConfig.get()["sentry"]);
|
||||||
setTimeout(() => {
|
|
||||||
try {
|
|
||||||
const e = new Error("whoops");
|
|
||||||
throw(e);
|
|
||||||
} catch (e) {
|
|
||||||
sendSentryReport("user text", "label", e);
|
|
||||||
}
|
|
||||||
}, 4000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async postLoginSetup() {
|
private async postLoginSetup() {
|
||||||
|
|
|
@ -116,7 +116,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
sendSentryReport(userText, this.state.issueUrl, this.props.error);
|
sendSentryReport(this.state.text, this.state.issueUrl, this.props.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
private onDownload = async (): Promise<void> => {
|
private onDownload = async (): Promise<void> => {
|
||||||
|
|
|
@ -84,7 +84,7 @@ class ConsoleLogger {
|
||||||
// In development, it can be useful to log complex cyclic
|
// In development, it can be useful to log complex cyclic
|
||||||
// objects to the console for inspection. This is fine for
|
// objects to the console for inspection. This is fine for
|
||||||
// the console, but default `stringify` can't handle that.
|
// the console, but default `stringify` can't handle that.
|
||||||
// We w orkaround this by using a special replacer function
|
// We workaround this by using a special replacer function
|
||||||
// to only log values of the root object and avoid cycles.
|
// to only log values of the root object and avoid cycles.
|
||||||
return JSON.stringify(arg, (key, value) => {
|
return JSON.stringify(arg, (key, value) => {
|
||||||
if (key && typeof value === "object") {
|
if (key && typeof value === "object") {
|
||||||
|
|
|
@ -115,7 +115,7 @@ export async function sendSentryReport(userText: string, issueUrl: string, error
|
||||||
const captureContext = {
|
const captureContext = {
|
||||||
"contexts": await getContexts(),
|
"contexts": await getContexts(),
|
||||||
"extra": {
|
"extra": {
|
||||||
"userText": userText,
|
"user_text": userText,
|
||||||
"issue_url": issueUrl,
|
"issue_url": issueUrl,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue