Create a partial universal export in case of errors
Summary: Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit# Attach what we can to the universal export file if any of the steps time out CHANGELOG: Add a universal debug export button Reviewed By: passy Differential Revision: D40552235 fbshipit-source-id: 775afccacf053fbcf764d1f39e93a89ad20dee0a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e886427003
commit
2289d6c0e2
@@ -471,9 +471,7 @@ function ExportEverythingEverywhereAllAtOnceButton() {
|
|||||||
<p>Exporting Flipper debug files from all devices...</p>
|
<p>Exporting Flipper debug files from all devices...</p>
|
||||||
<p>It could take a long time!</p>
|
<p>It could take a long time!</p>
|
||||||
<p>Let's count sheep while we wait: {sheepCount++}.</p>
|
<p>Let's count sheep while we wait: {sheepCount++}.</p>
|
||||||
<p>
|
<p>We'll skip it automatically if it exceeds 3 minutes.</p>
|
||||||
Scream for help if the sheep count reaches 42, but not earlier.
|
|
||||||
</p>
|
|
||||||
</>,
|
</>,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -491,14 +489,14 @@ function ExportEverythingEverywhereAllAtOnceButton() {
|
|||||||
<p>Exporting Flipper state...</p>
|
<p>Exporting Flipper state...</p>
|
||||||
<p>It also could take a long time!</p>
|
<p>It also could take a long time!</p>
|
||||||
<p>This time we could count dinosaurs: {dinosaursCount++}.</p>
|
<p>This time we could count dinosaurs: {dinosaursCount++}.</p>
|
||||||
<p>You already know what to do when the counter reaches 42.</p>
|
<p>We'll skip it automatically if it exceeds 2 minutes.</p>
|
||||||
</>,
|
</>,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
setStateExportMessage();
|
setStateExportMessage();
|
||||||
|
|
||||||
const interval = setInterval(setStateExportMessage, 1000);
|
const interval = setInterval(setStateExportMessage, 2000);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}
|
}
|
||||||
case 'archive': {
|
case 'archive': {
|
||||||
|
|||||||
@@ -8,7 +8,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {getLogger, DeviceDebugFile, DeviceDebugCommand} from 'flipper-common';
|
import {
|
||||||
|
getLogger,
|
||||||
|
DeviceDebugFile,
|
||||||
|
DeviceDebugCommand,
|
||||||
|
timeout,
|
||||||
|
} from 'flipper-common';
|
||||||
import {Store, MiddlewareAPI} from '../reducers';
|
import {Store, MiddlewareAPI} from '../reducers';
|
||||||
import {DeviceExport} from 'flipper-frontend-core';
|
import {DeviceExport} from 'flipper-frontend-core';
|
||||||
import {selectedPlugins, State as PluginsState} from '../reducers/plugins';
|
import {selectedPlugins, State as PluginsState} from '../reducers/plugins';
|
||||||
@@ -643,6 +648,7 @@ export async function exportEverythingEverywhereAllAtOnce(
|
|||||||
|
|
||||||
zip.file('flipper_logs.txt', serializedLogs);
|
zip.file('flipper_logs.txt', serializedLogs);
|
||||||
|
|
||||||
|
try {
|
||||||
// Step 2: Export device logs
|
// Step 2: Export device logs
|
||||||
onStatusUpdate?.('files');
|
onStatusUpdate?.('files');
|
||||||
const flipperFolderContent = await startDeviceFlipperFolderExport();
|
const flipperFolderContent = await startDeviceFlipperFolderExport();
|
||||||
@@ -671,16 +677,29 @@ export async function exportEverythingEverywhereAllAtOnce(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error(
|
||||||
|
'exportEverythingEverywhereAllAtOnce -> failed to export Flipper device debug data',
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Step 3: Export Flipper State
|
// Step 3: Export Flipper State
|
||||||
onStatusUpdate?.('state');
|
onStatusUpdate?.('state');
|
||||||
const exportablePlugins = getExportablePlugins(store.getState());
|
const exportablePlugins = getExportablePlugins(store.getState());
|
||||||
// TODO: no need to put this in the store,
|
// TODO: no need to put this in the store,
|
||||||
// need to be cleaned up later in combination with SupportForm
|
// need to be cleaned up later in combination with SupportForm
|
||||||
store.dispatch(selectedPlugins(exportablePlugins.map(({id}) => id)));
|
store.dispatch(selectedPlugins(exportablePlugins.map(({id}) => id)));
|
||||||
const {serializedString} = await exportStore(store);
|
const {serializedString} = await timeout(2 * 60 * 1000, exportStore(store));
|
||||||
|
|
||||||
zip.file('flipper_export', serializedString);
|
zip.file('flipper_export', serializedString);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(
|
||||||
|
'exportEverythingEverywhereAllAtOnce -> failed to export Flipper state',
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
onStatusUpdate?.('archive');
|
onStatusUpdate?.('archive');
|
||||||
const archiveData = await zip.generateAsync({type: 'uint8array'});
|
const archiveData = await zip.generateAsync({type: 'uint8array'});
|
||||||
|
|||||||
Reference in New Issue
Block a user