Merge pull request #6027 from element-hq/feature/bma/improveRageshake
Let rageshake description mention when a log file is missing
This commit is contained in:
commit
2534cd27e0
2 changed files with 11 additions and 5 deletions
|
|
@ -139,7 +139,7 @@ class PreferencesRootPresenter(
|
||||||
|
|
||||||
return PreferencesRootState(
|
return PreferencesRootState(
|
||||||
myUser = matrixUser.value,
|
myUser = matrixUser.value,
|
||||||
version = versionFormatter.get(),
|
version = remember { versionFormatter.get() },
|
||||||
deviceId = matrixClient.deviceId,
|
deviceId = matrixClient.deviceId,
|
||||||
isMultiAccountEnabled = isMultiAccountEnabled,
|
isMultiAccountEnabled = isMultiAccountEnabled,
|
||||||
otherSessions = otherSessions,
|
otherSessions = otherSessions,
|
||||||
|
|
|
||||||
|
|
@ -147,14 +147,19 @@ class DefaultBugReporter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val gzippedFiles = mutableListOf<File>()
|
val gzippedFiles = mutableListOf<File>()
|
||||||
|
var filesTooBig = 0
|
||||||
if (withDevicesLogs) {
|
if (withDevicesLogs) {
|
||||||
val files = getLogFiles().sortedByDescending { it.lastModified() }
|
val files = getLogFiles().sortedByDescending { it.lastModified() }
|
||||||
files.mapNotNullTo(gzippedFiles) { file ->
|
val filesBySize = files.groupBy {
|
||||||
|
it.length() < RageshakeConfig.MAX_LOG_CONTENT_SIZE
|
||||||
|
}
|
||||||
|
filesBySize[true].orEmpty().mapNotNullTo(gzippedFiles) { file ->
|
||||||
when {
|
when {
|
||||||
file.extension == "gz" -> file
|
file.extension == "gz" -> file
|
||||||
else -> compressFile(file)
|
else -> compressFile(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
filesTooBig = filesBySize[false].orEmpty().size
|
||||||
}
|
}
|
||||||
if (withCrashLogs || withDevicesLogs) {
|
if (withCrashLogs || withDevicesLogs) {
|
||||||
saveLogCat()
|
saveLogCat()
|
||||||
|
|
@ -192,7 +197,9 @@ class DefaultBugReporter(
|
||||||
.addFormDataPart("label", buildMeta.versionName)
|
.addFormDataPart("label", buildMeta.versionName)
|
||||||
.addFormDataPart("label", buildMeta.flavorDescription)
|
.addFormDataPart("label", buildMeta.flavorDescription)
|
||||||
.addFormDataPart("branch_name", buildMeta.gitBranchName)
|
.addFormDataPart("branch_name", buildMeta.gitBranchName)
|
||||||
|
if (filesTooBig > 0) {
|
||||||
|
builder.addFormDataPart("omitted_logs", filesTooBig.toString())
|
||||||
|
}
|
||||||
userId?.let {
|
userId?.let {
|
||||||
matrixClientProvider.getOrNull(it)?.let { client ->
|
matrixClientProvider.getOrNull(it)?.let { client ->
|
||||||
val curveKey = client.encryptionService.deviceCurve25519()
|
val curveKey = client.encryptionService.deviceCurve25519()
|
||||||
|
|
@ -394,8 +401,7 @@ class DefaultBugReporter(
|
||||||
logDirectory.listFiles()
|
logDirectory.listFiles()
|
||||||
?.filter {
|
?.filter {
|
||||||
it.isFile &&
|
it.isFile &&
|
||||||
!it.name.endsWith(LOG_CAT_FILENAME) &&
|
!it.name.endsWith(LOG_CAT_FILENAME)
|
||||||
it.length() < RageshakeConfig.MAX_LOG_CONTENT_SIZE
|
|
||||||
}
|
}
|
||||||
}.orEmpty()
|
}.orEmpty()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue