Type the electron and matrix plugin call sites instead of any. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-01 22:08:24 +11:00
parent eaa9ac00dd
commit 3781b05f6f
4 changed files with 67 additions and 54 deletions
+6 -6
View File
@@ -181,7 +181,7 @@ const setupKeyConflictHandler = (mx: MatrixClient, session: Session): void => {
// Since we can't directly intercept, we'll use a MutationObserver-style approach
// by checking for repeated key upload failures
const checkKeyConflict = (args: any[]): boolean => {
const checkKeyConflict = (args: unknown[]): boolean => {
const message = args.map((a) => String(a)).join(' ');
return keyConflictPattern.test(message);
};
@@ -190,7 +190,7 @@ const setupKeyConflictHandler = (mx: MatrixClient, session: Session): void => {
const originalError = console.error;
const originalWarn = console.warn;
const errorHandler = (...args: any[]) => {
const errorHandler = (...args: unknown[]) => {
if (checkKeyConflict(args)) {
keyConflictCount += 1;
console.log(
@@ -236,7 +236,7 @@ const setupKeyConflictHandler = (mx: MatrixClient, session: Session): void => {
};
console.error = errorHandler;
console.warn = (...args: any[]) => {
console.warn = (...args: unknown[]) => {
if (checkKeyConflict(args)) {
keyConflictCount += 1;
}
@@ -332,9 +332,9 @@ export const initClient = async (session: Session): Promise<MatrixClient> => {
console.log('[initMatrix] Registered global MatrixClient for auth utils');
return mx;
} catch (error: any) {
} catch (error) {
// Handle crypto store account mismatch error
if (error && error.message && error.message.includes("account in the store doesn't match")) {
if (error instanceof Error && error.message.includes("account in the store doesn't match")) {
console.error('[initMatrix] ❌ Crypto store account mismatch detected!');
console.error('[initMatrix] Error details:', error.message);
console.error('[initMatrix] Expected account:', session.userId, session.deviceId);
@@ -433,7 +433,7 @@ export const logoutClient = async (mx: MatrixClient) => {
const currentUserId = getLocalStorageItem('currentSessionUserId', undefined);
// Remove the current session
const remainingSessions = allSessions.filter((s: any) => s.userId !== userId);
const remainingSessions = allSessions.filter((s: Session) => s.userId !== userId);
setLocalStorageItem('matrixSessions', remainingSessions);
// If we're logging out the current session and there are other sessions, switch to the first one