Status Update
Comments
mk...@opera.com <mk...@opera.com> #2
Yoinking from triage
se...@opera.com <se...@opera.com> #3
Thanks for taking the time to file this issue!
Would you be able to provide more details about the scene and this error? I tried the following code:
@Preview
@Composable
fun AutofillTextField3() {
var password by remember { mutableStateOf("") }
val focusRequester = remember { FocusRequester() }
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
Column(Modifier.fillMaxWidth()) {
Text("Enter password")
TextField(
value = password,
onValueChange = { password = it },
modifier = Modifier
.fillMaxWidth()
.focusRequester(focusRequester)
.semantics { contentType = ContentType.Password },
label = { Text("password") },
placeholder = { Text("type your password here") }
)
}
}
but upon the app starting, Autofill displayed the suggestion chips along the keyboard for me. Verified that this is the case for BTF
as well.
Were you specifically using the Password
content type? The only way I was able to reproduce this was if the same code above instead had ContentType.NewUsername
set. In that case, you’re right—when the app starts, no suggestions are displayed. Only long-pressing and triggering autofill from the textbar menu displays the suggestions. I believe that is working as intended (as that is a field marked for new users and thus should not display previously saved data).
Are there any other details in the sample above that are missing?
to...@gmail.com <to...@gmail.com> #4
I think what I need to add to clarify is that the password fails to autocomplete when it's on another screen than the username field is. That seems to be the culprit.
I created a minimal example project which demonstrates this and also captured a video of the app running. From it you can see that the autofill chips appear briefly when navigating to the password screen. However, they disappear a moment after when the focus is requested.
Let me know if I can help providing any other information.
mk...@opera.com <mk...@opera.com> #5
Ah, I see what you're saying — thanks for the video and code! It seems like there’s two parts to this.
You mean that in a multi-page login, you would expect after selecting a credential chip, Autofill should fill in not only the first “username” on the first screen, but also “password” on the next screen. I believe this is working as intended. On the Compose side, it looks like we’re properly calling the autofill APIs. Looping in Kate from the autofill team to check: Kate, I double checked this with FormGen, and there’s the same behavior
The second part is that even if the password field is not immediately filled, the chips disappear after a second of being displayed. Unfortunately I was not able to reproduce this even running the sample code locally ― but I do notice that clicking the displayed chips on the password page does not autofill. Only after clicking autofill
in the text toolbar does selecting the chip actually invoke autofill. If the focusRequester
is removed from the code, then autofill works fine.
Seems like Compose is still properly sending the requested information over and calling the right APIs. I see that in both instances (in the working version without focusRequester
plus the one without it), Compose is calling notifyViewEntered
for the password screen, and then populateViewStructure
is called. But tapping onto the chip in the version with focusRequester
does not trigger autofill
(whereas it does without focusRequester
). I glanced over the semantic properties we send, and they look identical between both text fields.
I’m attaching some logs for the working version
di...@gmail.com <di...@gmail.com> #6
Correct, without focusRequester, tapping into the input field correctly populates the suggestion chips. With the focusRequester in place however, autofill chips appear but are immediately removed as shown on the video (probably due to the requested focus).
Thanks for looking into this.
da...@asana.com <da...@asana.com> #7
Triage: this P1 is nearly out of SLO.
mi...@outlook.com <mi...@outlook.com> #8
Thanks
ju...@ratpsmartsystems.com <ju...@ratpsmartsystems.com> #9
Project: platform/frameworks/support
Branch: androidx-main
Author: Melba Nuzen <
Link:
Only trigger commit
when no autofillable components onscreen
Expand for full commit details
Only trigger `commit` when no autofillable components onscreen
Fixes: 392539099
Test: `autofillManager_doNotCallCommit_partialRemoval` and others
Autocommit will only be invoked when there are no autofillable components currently displayed and when there were previously autofillable components onscreen. This prevents overeagerly calling `commit` in scenarios such as multipage logins. If developers need a session to be committed, they can still explicitly call `autofillManager.commit()` where needed.
Change-Id: Ic9ed6f9951163da3c39f31a771435eca14a8859a
Files:
- M
compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
- A
compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/autofill/MultiPageLoginDemo.kt
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/autofill/AndroidAutofillManagerTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AndroidAutofillManager.android.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AutofillUtils.android.kt
Hash: df2e791d1f2e01554961745cbb5cfcfb23b699a9
Date: Mon Feb 24 10:12:52 2025
br...@linear.app <br...@linear.app> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.8.0-rc01
androidx.compose.ui:ui-android:1.8.0-rc01
androidx.compose.ui:ui-jvmstubs:1.8.0-rc01
androidx.compose.ui:ui-linuxx64stubs:1.8.0-rc01
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