Skip to content

OkioStorage.createConnection #331

@slaldmi

Description

@slaldmi

Describe the bug?

I am using okta bom sdk redirect login model in my app and app is crashing for some play store users and stack trace log is as bellow.

      Fatal Exception: java.lang.IllegalStateException: There are multiple DataStores active for the same file: /data/user/0/com.cfna.app/files/datastore/com.okta.authfoundation.credential.storage.isStorageMigratedFromV1.preferences_pb. You should either maintain your DataStore as a singleton or confirm that there is no two DataStore's active on the same file (by confirming that the scope is cancelled).
   at androidx.datastore.core.okio.OkioStorage.createConnection(OkioStorage.java:65)
   at androidx.datastore.core.DataStoreImpl$storageConnectionDelegate$1.invoke(DataStoreImpl.java:189)
   at androidx.datastore.core.DataStoreImpl$storageConnectionDelegate$1.invoke(DataStoreImpl.java:188)
   at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
   at androidx.datastore.core.DataStoreImpl.getStorageConnection$datastore_core_release(DataStoreImpl.java:191)
   at androidx.datastore.core.DataStoreImpl$coordinator$2.invoke(DataStoreImpl.kt:192)
   at androidx.datastore.core.DataStoreImpl$coordinator$2.invoke(DataStoreImpl.kt:192)
   at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
   at androidx.datastore.core.DataStoreImpl.getCoordinator(DataStoreImpl.kt:192)
   at androidx.datastore.core.DataStoreImpl.readAndInitOrPropagateAndThrowFailure(DataStoreImpl.kt:272)
   at androidx.datastore.core.DataStoreImpl.access$readAndInitOrPropagateAndThrowFailure(DataStoreImpl.kt:53)
   at androidx.datastore.core.DataStoreImpl$readState$2.invokeSuspend(DataStoreImpl.kt:226)
   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
   at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:113)
   at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:589)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

What is expected to happen?

App should not crash

What is the actual behavior?

App. is crashing for few play store app users which is getting reported on firebase crashlytics

Reproduction Steps?

It is happening randomly for random users

Additional Information?

No response

SDK Version and Artifact(s) used.

Currently using OKTA BOM 2.0.2

com.okta.kotlin:auth-foundation
com.okta.kotlin:web-authentication-ui

Build Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions