[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:
Tasos Boulis
2022-12-02 16:33:42 +02:00
committed by GitHub
parent 567b48516b
commit 161ae99e94
36 changed files with 1809 additions and 30 deletions

View File

@@ -0,0 +1,39 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ElectronLog} from 'electron-log';
import {DiagnosticStepResponse} from 'types/diagnostics';
import config from 'common/config';
import DiagnosticsStep from '../DiagnosticStep';
const stepName = 'Step-9';
const stepDescriptiveName = 'Config';
const run = async (logger: ElectronLog): Promise<DiagnosticStepResponse> => {
try {
const payload = config.data;
return {
message: `${stepName} finished successfully`,
succeeded: true,
payload,
};
} catch (error) {
logger.warn(`Diagnostics ${stepName} Failure`, {error});
return {
message: `${stepName} failed`,
succeeded: false,
payload: error,
};
}
};
const Step9 = new DiagnosticsStep({
name: `diagnostic-${stepName}: ${stepDescriptiveName}`,
retries: 0,
run,
});
export default Step9;