Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [New arch] Crash when removing account #3721

Closed
jesmrec opened this issue Jul 29, 2022 · 0 comments · Fixed by #3725
Closed

[BUG] [New arch] Crash when removing account #3721

jesmrec opened this issue Jul 29, 2022 · 0 comments · Fixed by #3725
Assignees
Labels
Crash New architecture p2-high Escalation, on top of current planning, release blocker

Comments

@jesmrec
Copy link
Collaborator

jesmrec commented Jul 29, 2022

Steps to reproduce

  1. Add account
  2. Go to Manage Accounts and remove the account

Actual behaviour

App crashes

Expected behaviour

No crash

Crash is very long, i rescued these two interesting fragments:

2022-08-02 13:48:03.155 25970-25970/com.owncloud.android.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.owncloud.android.debug, PID: 25970
    java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
        at androidx.room.RoomDatabase.assertNotMainThread(RoomDatabase.java:469)
        at androidx.room.SharedSQLiteStatement.assertNotMainThread(SharedSQLiteStatement.java:60)
        at androidx.room.SharedSQLiteStatement.acquire(SharedSQLiteStatement.java:86)
        at com.owncloud.android.data.transfers.db.TransferDao_Impl.deleteTransfersWithAccountName(TransferDao_Impl.java:198)
        at com.owncloud.android.data.transfers.datasources.implementation.OCLocalTransferDataSource.removeAllTransfersFromAccount(OCLocalTransferDataSource.kt:59)
        at com.owncloud.android.data.transfers.repository.OCTransferRepository.removeAllTransfersFromAccount(OCTransferRepository.kt:60)
        at com.owncloud.android.usecases.transfers.uploads.CancelUploadsFromAccountUseCase.run(CancelUploadsFromAccountUseCase.kt:37)
        at com.owncloud.android.usecases.transfers.uploads.CancelUploadsFromAccountUseCase.run(CancelUploadsFromAccountUseCase.kt:29)
        at com.owncloud.android.domain.BaseUseCase.execute(BaseUseCase.kt:30)
        at com.owncloud.android.ui.activity.ManageAccountsActivity.run(ManageAccountsActivity.java:305)
        at android.accounts.AccountManager$Future2Task$1.run(AccountManager.java:2556)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7870)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
2022-08-02 13:48:04.458 28146-28146/com.owncloud.android.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.owncloud.android.debug, PID: 28146
    java.lang.NullPointerException: account ?: AccountUtils.…extProvider.getContext()) must not be null
        at com.owncloud.android.presentation.ui.files.filelist.MainFileListViewModel.composeFileListUiState(MainFileListViewModel.kt:257)
        at com.owncloud.android.presentation.ui.files.filelist.MainFileListViewModel.composeFileListUiState$default(MainFileListViewModel.kt:242)
        at com.owncloud.android.presentation.ui.files.filelist.MainFileListViewModel$_folderContentLiveData$lambda-1$$inlined$map$1.apply(Transformations.kt:89)
        at androidx.lifecycle.Transformations$1.onChanged(Transformations.java:76)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at androidx.lifecycle.Transformations$1.onChanged(Transformations.java:76)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
        at androidx.lifecycle.LiveData$1.run(LiveData.java:93)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7870)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
@jesmrec jesmrec added this to the 2.22-next milestone Jul 29, 2022
@jesmrec jesmrec mentioned this issue Jul 29, 2022
75 tasks
@jesmrec jesmrec added the p2-high Escalation, on top of current planning, release blocker label Aug 2, 2022
@JuancaG05 JuancaG05 self-assigned this Aug 4, 2022
@JuancaG05 JuancaG05 linked a pull request Aug 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash New architecture p2-high Escalation, on top of current planning, release blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants