Merge branches 'develop' and 'travis/download-logs' of github.com:matrix-org/matrix-react-sdk into travis/download-logs

 Conflicts:
	yarn.lock
This commit is contained in:
Michael Telatynski 2020-03-30 15:52:36 +01:00
commit 2a45ccaef3
411 changed files with 24018 additions and 11578 deletions

View file

@ -49,6 +49,18 @@ async function collectBugReport(opts) {
userAgent = window.navigator.userAgent;
}
let installedPWA = "UNKNOWN";
try {
// Known to work at least for desktop Chrome
installedPWA = window.matchMedia('(display-mode: standalone)').matches;
} catch (e) { }
let touchInput = "UNKNOWN";
try {
// MDN claims broad support across browsers
touchInput = window.matchMedia('(pointer: coarse)').matches;
} catch (e) { }
const client = MatrixClientPeg.get();
console.log("Sending bug report.");
@ -58,12 +70,21 @@ async function collectBugReport(opts) {
body.append('app', 'riot-web');
body.append('version', version);
body.append('user_agent', userAgent);
body.append('installed_pwa', installedPWA);
body.append('touch_input', touchInput);
if (client) {
body.append('user_id', client.credentials.userId);
body.append('device_id', client.deviceId);
}
const keys = [`ed25519:${client.getDeviceEd25519Key()}`];
if (client.getDeviceCurve25519Key) {
keys.push(`curve25519:${client.getDeviceCurve25519Key()}`);
}
body.append('device_keys', keys.join(', '));
body.append('cross_signing_key', client.getCrossSigningId());
if (opts.label) {
body.append('label', opts.label);
}
@ -74,6 +95,29 @@ async function collectBugReport(opts) {
body.append('enabled_labs', enabledLabs.join(', '));
}
// add storage persistence/quota information
if (navigator.storage && navigator.storage.persisted) {
try {
body.append("storageManager_persisted", await navigator.storage.persisted());
} catch (e) {}
} else if (document.hasStorageAccess) { // Safari
try {
body.append("storageManager_persisted", await document.hasStorageAccess());
} catch (e) {}
}
if (navigator.storage && navigator.storage.estimate) {
try {
const estimate = await navigator.storage.estimate();
body.append("storageManager_quota", estimate.quota);
body.append("storageManager_usage", estimate.usage);
if (estimate.usageDetails) {
Object.keys(estimate.usageDetails).forEach(k => {
body.append(`storageManager_usage_${k}`, estimate.usageDetails[k]);
});
}
} catch (e) {}
}
if (opts.sendLogs) {
progressCallback(_t("Collecting logs"));
const logs = await rageshake.getLogsForReport();