Skip to content

Commit 5c30c00

Browse files
committed
user_consistency_checking_failed to Plausible
The endpoint no longer accepts these events, but Plausible will.
1 parent 6aca352 commit 5c30c00

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/app/state/middleware/userConsistencyChecker.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Dispatch, Middleware, MiddlewareAPI} from "redux";
22
import {RegisteredUserDTO} from "../../../IsaacApiTypes";
3-
import {ACTION_TYPE, isDefined} from "../../services";
3+
import {ACTION_TYPE, isDefined, trackEvent} from "../../services";
44
import {redirectTo, getUserId, logAction, setUserId, AppDispatch, changePage} from "../index";
55

66
let timeoutHandle: number | undefined;
@@ -10,7 +10,6 @@ let timeoutHandle: number | undefined;
1010
// use it asynchronously, so that is what we do.
1111

1212
const scheduleNextCheck = (middleware: MiddlewareAPI) => {
13-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
1413
timeoutHandle = window.setTimeout(() => checkUserConsistency(middleware), 1000);
1514
};
1615

@@ -32,19 +31,13 @@ const checkUserConsistency = (middleware: MiddlewareAPI) => {
3231

3332

3433
const setCurrentUser = (user: RegisteredUserDTO, api: MiddlewareAPI) => {
35-
const dispatch = api.dispatch as AppDispatch;
3634
clearTimeout(timeoutHandle);
3735
// Only start checking if we can successfully store the user id
3836
if (setUserId(user._id)) {
3937
scheduleNextCheck(api);
4038
} else {
41-
// eslint-disable-next-line no-console
4239
console.error("Cannot perform user consistency checking!");
43-
const eventDetails = {
44-
type: "USER_CONSISTENCY_CHECKING_FAILED",
45-
userAgent: navigator.userAgent,
46-
};
47-
dispatch(logAction(eventDetails));
40+
trackEvent("exception", { props: { description: "user_consistency_checking_failed", fatal: false }});
4841
}
4942
};
5043

0 commit comments

Comments
 (0)