Status Update
Comments
mk...@opera.com <mk...@opera.com> #2
Branch: androidx-master-dev
commit 8739fcde521e3f7f92111b7424ab924fb22eed16
Author: rohitsat13 <rohitsat@google.com>
Date: Fri Nov 20 10:29:57 2020
RxDataStore.kt, the RxJava wrapper for the core API.
Future cls: 1) RxDataBuilder 2) RxDataMigration
Test: RxDataStoreTest.java
Relnote: There is now a RxJava Wrapper for the core DataStore API. Future updates will include a Builder and RxDataMigrations.
Bug: 170311106
Change-Id: I3e7e099488035cca906b5f6e6de0a387acb5b964
A datastore/datastore-rxjava2/api/current.txt
A datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
A datastore/datastore-rxjava2/api/res-current.txt
A datastore/datastore-rxjava2/api/restricted_current.txt
A datastore/datastore-rxjava2/build.gradle
A datastore/datastore-rxjava2/src/main/AndroidManifest.xml
A datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataStore.kt
A datastore/datastore-rxjava2/src/test-common/java/androidx/datastore/rxjava2/TestingSerializer.kt
A datastore/datastore-rxjava2/src/test/java/androidx/datastore/rxjava2/RxDataStoreTest.java
M docs-tip-of-tree/build.gradle
M settings.gradle
se...@opera.com <se...@opera.com> #3
Branch: androidx-master-dev
commit a65952abc062e0b8cde3b291cde64c804b70701c
Author: rohitsat13 <rohitsat@google.com>
Date: Fri Nov 20 10:39:49 2020
RxDataStoreBuilder.kt to make constructing DataStores from java easier.
Relnote: Added a builder to make constructing Datastores from java easier.
Test: RxDataStoreBuilderTest
Bug: 170311106
Change-Id: Id2b5a4fdcd166cab45aea92db6e76f9e7814e24f
M datastore/datastore-rxjava2/api/current.txt
M datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava2/api/restricted_current.txt
A datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/AssertThrows.kt
A datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxDataStoreBuilderTest.java
A datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataStoreBuilder.kt
to...@gmail.com <to...@gmail.com> #4
Branch: androidx-master-dev
commit 0e34cf4861bfffcd328a07d59fdeb78f7211019c
Author: rohitsat13 <rohitsat@google.com>
Date: Mon Nov 30 14:06:48 2020
Modify RxDataStoreBuilder constructors to accept required params.
Test: Modified existing tests.
Bug: 170311106
Relnote: N/A
Change-Id: I7f4190dec2f4f62500818c97f2beb55034774c35
M datastore/datastore-rxjava2/api/current.txt
M datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava2/api/restricted_current.txt
M datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxDataStoreBuilderTest.java
M datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataStoreBuilder.kt
mk...@opera.com <mk...@opera.com> #5
Branch: androidx-master-dev
commit aba42ee317b69068fb6da49575dca03671ec547f
Author: rohitsat13 <rohitsat@google.com>
Date: Fri Nov 20 10:40:14 2020
RxDataMigration and RxSharedPreferencesMigration.
Add a wrapper for the RxDataMigration interface so that people can define migrations using RxJava
Relnote: """Added support for migrations written using RxJava with the RxDataMigration interface. The RxDataMigration interface is like the DataMigration interface, except using reactivex.Single's instead of suspend functions. You can implement this interface to define a custom migration.
This change also adds support for SharedPreferencesMigrationBuilder which allows easier construction of SharedPreferencesMigrations from java.
"""
Test: RxSharedPreferencesMigrationTest.kt
Bug: 170311106
Change-Id: If929664956cd1434eee5178432958b58722cd76c
M datastore/datastore-rxjava2/api/current.txt
M datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava2/api/restricted_current.txt
M datastore/datastore-rxjava2/build.gradle
M datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxDataStoreBuilderTest.java
A datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxSharedPreferencesMigrationTest.java
A datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataMigration.java
M datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataStoreBuilder.kt
A datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxSharedPreferencesMigration.kt
M testutils/testutils-truth/src/main/java/androidx/testutils/assertions.kt
A testutils/testutils-truth/src/test/java/androidx/testutils/AssertionsTest.kt
di...@gmail.com <di...@gmail.com> #6
Branch: androidx-master-dev
commit 842f0818490cd3f31806c13bd2c0db681ac67e46
Author: rohitsat13 <rohitsat@google.com>
Date: Fri Dec 11 11:30:24 2020
Split preferencesKey<T> into individual types, e.g. intPreferencesKey, longPreferencesKey, etc.
Test: PreferencesFromJavaTest
Relnote: """ The preferencesKey<T>(name: String): Key<T> method has been removed and replaced with methods specific to each supported type, for example preferencesKey<Int>("int") is now preferencesIntKey("int") """
Bug: 170311106
Change-Id: Ibcfac9cca7c8a3dbf2eaae17bdb8c22a8ce5a9f7
M datastore/datastore-preferences-core/api/current.txt
M datastore/datastore-preferences-core/api/public_plus_experimental_current.txt
M datastore/datastore-preferences-core/api/restricted_current.txt
M datastore/datastore-preferences-core/src/main/java/androidx/datastore/preferences/core/Preferences.kt
A datastore/datastore-preferences-core/src/main/java/androidx/datastore/preferences/core/PreferencesFactory.kt
A datastore/datastore-preferences-core/src/main/java/androidx/datastore/preferences/core/PreferencesKeys.kt
M datastore/datastore-preferences-core/src/main/java/androidx/datastore/preferences/core/PreferencesSerializer.kt
M datastore/datastore-preferences-core/src/test/java/androidx/datastore/preferences/core/PreferenceDataStoreFactoryTest.kt
A datastore/datastore-preferences-core/src/test/java/androidx/datastore/preferences/core/PreferencesFromJavaTest.java
M datastore/datastore-preferences-core/src/test/java/androidx/datastore/preferences/core/PreferencesSerializerTest.kt
M datastore/datastore-preferences-core/src/test/java/androidx/datastore/preferences/core/PreferencesTest.kt
M datastore/datastore-preferences/src/androidTest/java/androidx/datastore/preferences/PreferenceDataStoreFactoryTest.kt
M datastore/datastore-preferences/src/androidTest/java/androidx/datastore/preferences/SharedPreferencesToPreferencesTest.kt
M datastore/datastore-preferences/src/main/java/androidx/datastore/preferences/SharedPreferencesMigration.kt
M datastore/datastore-sampleapp/src/main/java/com/example/datastoresampleapp/PreferencesDataStoreActivity.kt
da...@asana.com <da...@asana.com> #7
Branch: androidx-main
commit 431cd63a24c2b35a543f5b6fda6ec5e088d06b3c
Author: rohitsat13 <rohitsat@google.com>
Date: Mon Dec 21 11:42:56 2020
Added datastore-rxjava3 and datastore-preferences-rxjava3.
I just copied the rxjava2 modules and replaced the imports with rxjava3 imports.
Test: Copied over tests from rxjava2 modules.
Relnote: This change adds the datastore-preferences-rxjava2 and datastore-preferences-rxjava3 modules
Bug: 170311106
Change-Id: If253fe05877f22b956cda2e2be27387ae76c9b33
A datastore/datastore-preferences-rxjava3/api/current.txt
A datastore/datastore-preferences-rxjava3/api/public_plus_experimental_current.txt
A datastore/datastore-preferences-rxjava3/api/res-current.txt
A datastore/datastore-preferences-rxjava3/api/restricted_current.txt
A datastore/datastore-preferences-rxjava3/build.gradle
A datastore/datastore-preferences-rxjava3/src/androidTest/java/androidx/datastore/preferences/rxjava3/RxPreferencesDataStoreBuilderTest.java
A datastore/datastore-preferences-rxjava3/src/main/AndroidManifest.xml
A datastore/datastore-preferences-rxjava3/src/main/java/androidx/datastore/preferences/rxjava3/RxPreferenceDataStoreBuilder.kt
A datastore/datastore-rxjava3/api/current.txt
A datastore/datastore-rxjava3/api/public_plus_experimental_current.txt
A datastore/datastore-rxjava3/api/res-current.txt
A datastore/datastore-rxjava3/api/restricted_current.txt
A datastore/datastore-rxjava3/build.gradle
A datastore/datastore-rxjava3/src/androidTest/AndroidManifest.xml
A datastore/datastore-rxjava3/src/androidTest/java/androidx/datastore/rxjava3/RxDataStoreBuilderTest.java
A datastore/datastore-rxjava3/src/androidTest/java/androidx/datastore/rxjava3/RxSharedPreferencesMigrationTest.java
A datastore/datastore-rxjava3/src/main/AndroidManifest.xml
A datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataMigration.java
A datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataStore.kt
A datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataStoreBuilder.kt
A datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxSharedPreferencesMigration.kt
A datastore/datastore-rxjava3/src/test-common/java/androidx/datastore/rxjava3/TestingSerializer.kt
A datastore/datastore-rxjava3/src/test/java/androidx/datastore/rxjava3/RxDataStoreTest.java
M settings.gradle
mi...@outlook.com <mi...@outlook.com> #8
Branch: androidx-main
commit 4767533679a08261b7f5db398ea9b8cab13f4257
Author: rohitsat13 <rohitsat@google.com>
Date: Mon Nov 23 15:53:12 2020
Add datastore-preferences-rxjava2 module so people can build and use Preferences DataStore from java.
Test: Added tests for builder and RxPreferences
RelNote: Added RxPreferences so people can create Preferences keys from java and added RxPreferenceDataStoreBuilder so people can easily construct DataStore<Preferences>.
Bug: 170311106
Change-Id: I6b46555d67bf6bb61800b3fad0a7c27b72183ade
A datastore/datastore-preferences-rxjava2/api/current.txt
A datastore/datastore-preferences-rxjava2/api/public_plus_experimental_current.txt
A datastore/datastore-preferences-rxjava2/api/res-current.txt
A datastore/datastore-preferences-rxjava2/api/restricted_current.txt
A datastore/datastore-preferences-rxjava2/build.gradle
A datastore/datastore-preferences-rxjava2/src/androidTest/java/androidx/datastore/preferences/rxjava2/RxPreferencesDataStoreBuilderTest.java
A datastore/datastore-preferences-rxjava2/src/main/AndroidManifest.xml
A datastore/datastore-preferences-rxjava2/src/main/java/androidx/datastore/preferences/rxjava2/RxPreferenceDataStoreBuilder.kt
D datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/AssertThrows.kt
M settings.gradle
br...@linear.app <br...@linear.app> #10
Downgrading from 1.1.1 to 1.0.0 has seemingly resolved the issue for us.
mk...@opera.com <mk...@opera.com> #11
Downgrading is not an option for us as we need multiplatform support.
dc...@openai.com <dc...@openai.com> #12
Right now, there doesn't seem to be a straightforward way to change the error handling here, without adding an abstraction above the DataStore itself.
ja...@gmail.com <ja...@gmail.com> #13
I'm not sure why the above error is happening. It seems to be expecting the file to be created first and then queried.
Is there a timing issue?
dc...@openai.com <dc...@openai.com> #14
du...@gmail.com <du...@gmail.com> #15
zh...@google.com <zh...@google.com> #16
Sorry for the delay of responding to this issue, as we've seen similar issues in the other bugs and followed up there. This is hard for us to debug as it seems to be a race condition and we cannot easily reproduce it and understand the root cause. Please help us by providing more details (device populations, API levels, or anything you discover as relevant to the bug distribution) from your observation of its occurrence! Also a sample app to reproduce would be great if possible.
In the meantime, I'll try to do some more investigation with the given information. Thanks for your patience.
ps...@google.com <ps...@google.com> #17
It does not seem to be limited to a specific API, I see logs on API 10 to 15.
These are the errors I see on Crashlytics on a Pixel 8 Pro (unfortunately I have not been able to reproduce locally):
Fatal Exception: java.io.FileNotFoundException: /data/user/0/com.myapp/files/datastore/tracked apps.preferences_pb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:574)
at java.io.FileInputStream.<init>(FileInputStream.java:179)
at okio.Okio__JvmOkioKt.source(Okio__JvmOkio.kt:181)
at okio.Okio.source(Okio.java:1)
at okio.JvmSystemFileSystem.source(JvmSystemFileSystem.java:96)
at androidx.datastore.core.okio.OkioReadScope.readData$suspendImpl(OkioStorage.kt:227)
at androidx.datastore.core.okio.OkioReadScope.readData(OkioStorage.kt:1)
at androidx.datastore.core.StorageConnectionKt$readData$2.invokeSuspend(StorageConnection.kt:74)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:20)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:20)
at androidx.datastore.core.okio.OkioStorageConnection.readScope(OkioStorage.kt:113)
at androidx.datastore.core.StorageConnectionKt.readData(StorageConnection.kt:74)
at androidx.datastore.core.DataStoreImpl.readDataFromFileOrDefault(DataStoreImpl.kt:331)
at androidx.datastore.core.DataStoreImpl.access$readDataFromFileOrDefault(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invokeSuspend(DataStoreImpl.kt:378)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.SingleProcessCoordinator.tryLock(SingleProcessCoordinator.kt:50)
at androidx.datastore.core.DataStoreImpl.readDataOrHandleCorruption(DataStoreImpl.kt:377)
at androidx.datastore.core.DataStoreImpl.access$readDataOrHandleCorruption(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invokeSuspend(DataStoreImpl.kt:314)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.SingleProcessCoordinator.tryLock(SingleProcessCoordinator.kt:50)
at androidx.datastore.core.DataStoreImpl.readDataAndUpdateCache(DataStoreImpl.kt:312)
at androidx.datastore.core.DataStoreImpl.access$readDataAndUpdateCache(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readState$2.invokeSuspend(DataStoreImpl.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Linux.java)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8591)
at libcore.io.IoBridge.open(IoBridge.java:560)
at java.io.FileInputStream.<init>(FileInputStream.java:179)
at okio.Okio__JvmOkioKt.source(Okio__JvmOkio.kt:181)
at okio.Okio.source(Okio.java:1)
at okio.JvmSystemFileSystem.source(JvmSystemFileSystem.java:96)
at androidx.datastore.core.okio.OkioReadScope.readData$suspendImpl(OkioStorage.kt:227)
at androidx.datastore.core.okio.OkioReadScope.readData(OkioStorage.kt:1)
at androidx.datastore.core.StorageConnectionKt$readData$2.invokeSuspend(StorageConnection.kt:74)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:20)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:20)
at androidx.datastore.core.okio.OkioStorageConnection.readScope(OkioStorage.kt:113)
at androidx.datastore.core.StorageConnectionKt.readData(StorageConnection.kt:74)
at androidx.datastore.core.DataStoreImpl.readDataFromFileOrDefault(DataStoreImpl.kt:331)
at androidx.datastore.core.DataStoreImpl.access$readDataFromFileOrDefault(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invokeSuspend(DataStoreImpl.kt:378)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.DataStoreImpl$readDataOrHandleCorruption$2.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.SingleProcessCoordinator.tryLock(SingleProcessCoordinator.kt:50)
at androidx.datastore.core.DataStoreImpl.readDataOrHandleCorruption(DataStoreImpl.kt:377)
at androidx.datastore.core.DataStoreImpl.access$readDataOrHandleCorruption(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invokeSuspend(DataStoreImpl.kt:314)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.DataStoreImpl$readDataAndUpdateCache$4.invoke(DataStoreImpl.kt:16)
at androidx.datastore.core.SingleProcessCoordinator.tryLock(SingleProcessCoordinator.kt:50)
at androidx.datastore.core.DataStoreImpl.readDataAndUpdateCache(DataStoreImpl.kt:312)
at androidx.datastore.core.DataStoreImpl.access$readDataAndUpdateCache(DataStoreImpl.kt:53)
at androidx.datastore.core.DataStoreImpl$readState$2.invokeSuspend(DataStoreImpl.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
ma...@marcardar.com <ma...@marcardar.com> #18
I've also been seeing this since updating from 1.0.0 (problem exists in both 1.1.0 and 1.1.1) and so I had to downgrade to 1.0.0 to avoid these crashes.
Has anyone tried:
UPDATE: no it doesn't help
ma...@marcardar.com <ma...@marcardar.com> #19
ni...@usecopper.com <ni...@usecopper.com> #20
in...@gmail.com <in...@gmail.com> #21
el...@google.com <el...@google.com>
el...@google.com <el...@google.com> #22
Hi there - we were able to reproduce the issue on our end, a fix is in the works. I'll update here once we have it merged & ready for release.
el...@google.com <el...@google.com> #23
This issue should be fixed for the upcoming 1.1.3 release. Please let us know if the issue persists after the release.
ap...@google.com <ap...@google.com> #24
Project: platform/frameworks/support
Branch: androidx-main
Author: elifbilgin <
Link:
Resolve FileNotFoundException issue in OkioStorage at startup.
Expand for full commit details
Resolve FileNotFoundException issue in OkioStorage at startup.
This change introduces a second attempt at reading a file in OkioStorage `readData()`, in case the initial read attempt failed due to a race condition caused by in the file being created by a different process.
Bug: 337870543
Test: Tested locally via aosp/3496411.
Change-Id: I43b3fb565cc76344bc14c7dc3964ff76b2319358
Files:
- M
datastore/datastore-core-okio/src/commonMain/kotlin/androidx/datastore/core/okio/OkioStorage.kt
- A
datastore/datastore-core-okio/src/commonTest/kotlin/androidx/datastore/core/okio/OkioFakeFileSystem.kt
- M
datastore/datastore-core-okio/src/commonTest/kotlin/androidx/datastore/core/okio/OkioStorageTest.kt
- M
datastore/datastore-core/src/jvmAndroidMain/kotlin/androidx/datastore/core/FileStorage.kt
Hash: 3e2cc72ab89a0c011f99627a61eba045d7378cb5
Date: Thu Feb 13 23:25:56 2025
ki...@protonmail.com <ki...@protonmail.com> #25
still present in 1.1.2
only present on Android/JVM no problem on iOS
el...@google.com <el...@google.com> #26
Thanks for the update regarding the platform specific behavior, we are still working on pinpointing the issue
el...@google.com <el...@google.com> #27
el...@google.com <el...@google.com> #28
Apologies, this issue is resolved and the fix will be available in 1.1.3
Description
DataStore Component used: androidx.datastore for Android DataStore Version used:
1.1.0
Devices/Android versions reproduced on: Seems not connected to any specific device/Android version as we see it on many different ones on all Android versions.After updating androidx.datastore from
1.0.0
to1.1.0
we started to see a lot of the following crashes.runBlocking
to read from the datastore in one place