Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
good catch. we also plan to change this to allow access in single process so this might become obselete but that part is not implemented yet and I'm not sure if it will make it into 1.1.
best we fix this meanwhile.
yb...@google.com <yb...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 908c08d14daa9d1caaf3dea3b307bc485394fa22
Author: Yigit Boyar <yboyar@google.com>
Date: Mon Aug 28 09:19:19 2023
User normalized paths for duplicate file detection
This CL fixes a bug where neither FileStorage nor OkioStorage
normalizes the path before checking for duplicates, hence might
allow multiple DS instances on the same file.
This CL fixes it and expands the test case to cover it.
Fixes: 273885132
Test: SingleProcessDataStoreTest
Change-Id: Ifd221cb2fe650bef9e587a64b7f74ea35870cf70
M datastore/datastore-core-okio/src/commonMain/kotlin/androidx/datastore/core/okio/OkioStorage.kt
M datastore/datastore-core/src/commonTest/kotlin/androidx/datastore/core/SingleProcessDataStoreTest.kt
M datastore/datastore-core/src/jvmMain/kotlin/androidx/datastore/core/FileStorage.kt
M testutils/testutils-datastore/src/commonMain/kotlin/androidx/datastore/OkioTestIO.kt
M testutils/testutils-datastore/src/commonMain/kotlin/androidx/datastore/TestIO.kt
M testutils/testutils-datastore/src/jvmMain/kotlin/androidx/datastore/FileTestIO.kt
https://android-review.googlesource.com/2729273
Branch: androidx-main
commit 908c08d14daa9d1caaf3dea3b307bc485394fa22
Author: Yigit Boyar <yboyar@google.com>
Date: Mon Aug 28 09:19:19 2023
User normalized paths for duplicate file detection
This CL fixes a bug where neither FileStorage nor OkioStorage
normalizes the path before checking for duplicates, hence might
allow multiple DS instances on the same file.
This CL fixes it and expands the test case to cover it.
Fixes: 273885132
Test: SingleProcessDataStoreTest
Change-Id: Ifd221cb2fe650bef9e587a64b7f74ea35870cf70
M datastore/datastore-core-okio/src/commonMain/kotlin/androidx/datastore/core/okio/OkioStorage.kt
M datastore/datastore-core/src/commonTest/kotlin/androidx/datastore/core/SingleProcessDataStoreTest.kt
M datastore/datastore-core/src/jvmMain/kotlin/androidx/datastore/core/FileStorage.kt
M testutils/testutils-datastore/src/commonMain/kotlin/androidx/datastore/OkioTestIO.kt
M testutils/testutils-datastore/src/commonMain/kotlin/androidx/datastore/TestIO.kt
M testutils/testutils-datastore/src/jvmMain/kotlin/androidx/datastore/FileTestIO.kt
pr...@google.com <pr...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.datastore:datastore-core:1.1.0-alpha05
androidx.datastore:datastore-core-android:1.1.0-alpha05
androidx.datastore:datastore-core-iosarm64:1.1.0-alpha05
androidx.datastore:datastore-core-iossimulatorarm64:1.1.0-alpha05
androidx.datastore:datastore-core-iosx64:1.1.0-alpha05
androidx.datastore:datastore-core-jvm:1.1.0-alpha05
androidx.datastore:datastore-core-linuxx64:1.1.0-alpha05
androidx.datastore:datastore-core-macosarm64:1.1.0-alpha05
androidx.datastore:datastore-core-macosx64:1.1.0-alpha05
androidx.datastore:datastore-core-okio:1.1.0-alpha05
androidx.datastore:datastore-core-okio-iosarm64:1.1.0-alpha05
androidx.datastore:datastore-core-okio-iossimulatorarm64:1.1.0-alpha05
androidx.datastore:datastore-core-okio-iosx64:1.1.0-alpha05
androidx.datastore:datastore-core-okio-jvm:1.1.0-alpha05
androidx.datastore:datastore-core-okio-linuxx64:1.1.0-alpha05
androidx.datastore:datastore-core-okio-macosarm64:1.1.0-alpha05
androidx.datastore:datastore-core-okio-macosx64:1.1.0-alpha05
Description
DataStore Version used: 1.0.0
Devices/Android versions reproduced on: Any
'activeFiles' collection operates on absolute file path which doesn't have to be unique for same file.
Take a look on following example:
DataStoreFactory.create(...) { File("/path/to/file") }
DataStoreFactory.create(...) { File("/path/to/./file") }
Both DataStores work on same file but the internal verification mechanism won't work in this case as it operates on absolute paths.
Please consider operating on canonical path.