Skip to content

Commit

Permalink
Merge pull request #4296 from owncloud/fix/crash_named_logs
Browse files Browse the repository at this point in the history
[FIX] Hardcoded name in logs leads to crash
  • Loading branch information
Aitorbp authored Jan 29, 2024
2 parents ae83fd5 + e3b0d7e commit b7150c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ownCloud admins and users.
* Bugfix - Conflict in copy with files without extension: [#4222](https://github.com/owncloud/android/issues/4222)
* Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260)
* Bugfix - Fix in the handling of the base URL: [#4279](https://github.com/owncloud/android/issues/4279)
* Bugfix - Handle Http 423 (resource locked): [#4282](https://github.com/owncloud/android/issues/4282)
* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293)
* Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962)
* Enhancement - Koin DSL: [#3966](https://github.com/owncloud/android/pull/3966)
Expand Down Expand Up @@ -123,6 +124,14 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4279
https://github.com/owncloud/android/pull/4287

* Bugfix - Handle Http 423 (resource locked): [#4282](https://github.com/owncloud/android/issues/4282)

App can gracefully show if the file is locked when done certain operations on
it.

https://github.com/owncloud/android/issues/4282
https://github.com/owncloud/android/pull/4285

* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293)

Copying a folder into another folder with the same name in a different space now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ class OCFileLoggingTree(
it.list()?.let { logFiles ->
if (logFiles.isNotEmpty()) {

val lastDateLogFileString = logFiles.last().substringAfterLast("owncloud.").substringBeforeLast(".log")
val lastDateLogFileString = if (context != null) {
logFiles.last().substringAfterLast("${context.packageName}.").substringBeforeLast(".log")
} else {
logFiles.last().substringAfterLast("$filename.").substringBeforeLast(".log")
}

val dateFormat = SimpleDateFormat(LOG_FILE_TIME_FORMAT)
val lastDayLogFileDate = dateFormat.parse(lastDateLogFileString)
Expand Down

0 comments on commit b7150c5

Please sign in to comment.