[MM-47202] - Desktop diagnostics (#2439)
* Add custom assertion to match object in array (#2358) * Add custom assertion to match object in array * Remove test that is not implemented yet * [MM-48213] Add "Run diagnostics" menu item under Help (#2359) * Add submenu item that runs diagnostics * Add custom assertion to match object in array * Remove test that is not implemented yet * Add tests * Add translation * [MM-47206] Diagnostics steps setup (#2361) * Add baseline code for diagnostics and their steps * Fix failing test * [MM-47206] [MM-48155] Obfuscate logs (#2369) * Add logging hooks to mask sensitive data * Add hook that truncates long strings in diagnostics logs * Add template file for creating steps * Add readme inside diagnostics * [MM-48145] Diagnostics step 2 - internet connectivity (#2372) * Add diagnostics step 2 - internet connectivity check * Update tests * [MM-48144] Diagnostics Step - Configure logger (#2390) * Configure logger * Move configure logger into step1 * Add file extension to fileName variable * Diagnostics Step 2: Validate configuration (#2391) * Resolve conflicts with base branch * Update test and implement Code review suggestion * Fix failing test * [MM-48147]Diagnostics step 3 - server connectivity (#2397) * Add step3: Check server connectivity by using the /api/v4/system/ping endpoint * Fix failing tests * Add better obfuscator functions that mask all types of data (#2399) * Add better obfuscator functions that mask all types of data(string, array, objects) * Update tests * [MM-48148] Add Diagnostics step 4 - session validation (#2398) * Add diagnostics step 4 - session data validation * Fix failing tests * [MM-48152] Add diagnostics step 5 - BrowserWindows checks (#2404) * Add diagnostics step 5 - browserwindow checks for main window * Add tests * [MM-48151] Diagnostics step 6 - Permissions (#2409) * Add diagnostics step 6 - Permissions check * Check permissions for microphone ond screen onn mac, windows * Update tests count in tests * [MM-48551] Diagnostics step 7 - Performance & Memory (#2410) * Add diagnostics step 6 - Permissions check * Check permissions for microphone ond screen onn mac, windows * Update tests count in tests * Add diagnostics step 7 - performance and memory * Fix failing tests * [MM-48153] Add diagnostics step 8 - Log heuristics (#2418) * Add diagnostics step 8 - Log heuristics * Add diagnostics step 9 - config (#2422) * [MM-48556] Diagnostics Step 10 - Crash reports (#2423) * Add diagnostics step 9 - config * Add diagnostics step 10 - include crash reports * Update tests * Add diagnostics step 11 - cookies report (#2427) * [MM-48157] Diagnostics report (#2432) * Add better logging and pretty print report * Update last step * Update log message * Move log after hooks so that path is masked * Use correct directory for diagnostics files
This commit is contained in:
51
src/types/diagnostics.ts
Normal file
51
src/types/diagnostics.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {ElectronLog, LogLevel} from 'electron-log';
|
||||
|
||||
export type DiagnosticsStepConstructorPayload = {
|
||||
name: string;
|
||||
retries: number;
|
||||
run: (logger: ElectronLog) => Promise<DiagnosticStepResponse>;
|
||||
}
|
||||
|
||||
export type DiagnosticStepResponse = {
|
||||
succeeded: boolean;
|
||||
message?: string;
|
||||
payload?: unknown;
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export type DiagnosticsReportObject = DiagnosticStepResponse & {
|
||||
step: number;
|
||||
name: DiagnosticsStepConstructorPayload['name'];
|
||||
}
|
||||
|
||||
export type AddDurationToFnReturnObject =
|
||||
(run: (logger: ElectronLog) => Promise<DiagnosticStepResponse>)
|
||||
=> (logger: ElectronLog)
|
||||
=> Promise<Omit<DiagnosticStepResponse, 'duration'> & {duration: number}>;
|
||||
|
||||
export type DiagnosticsReport = DiagnosticsReportObject[];
|
||||
|
||||
export type WindowStatus = Array<{
|
||||
name: string;
|
||||
ok: boolean;
|
||||
data?: unknown;
|
||||
}>;
|
||||
|
||||
export type LogFileLineData = {
|
||||
text: string;
|
||||
logLevel?: LogLevel;
|
||||
date?: string;
|
||||
}
|
||||
|
||||
export type LogLevelAmounts = {
|
||||
silly: number;
|
||||
debug: number;
|
||||
verbose: number;
|
||||
info: number;
|
||||
warn: number;
|
||||
error: number;
|
||||
}
|
||||
|
Reference in New Issue
Block a user