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] App crashes when last account is removed from device's settings #4431

Open
jesmrec opened this issue Jul 1, 2024 · 8 comments
Open

Comments

@jesmrec
Copy link
Collaborator

jesmrec commented Jul 1, 2024

This one comes from #4410 (comment)

Steps:

  1. Add one account to the device
  2. Switch to device settings without closing the app
  3. Accounts -> oC account -> Remove Account
  4. Switch to oC account

Current:

app crashes, this is the stacktrace:

 FATAL EXCEPTION: DefaultDispatcher-worker-15
                 Process: com.owncloud.android.debug, PID: 32604
                 java.lang.NullPointerException: Parameter specified as non-null is null: method com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel, parameter <this>
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel(Unknown Source:2)
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource.getSpaceWithSpecialsByIdForAccount(OCLocalSpacesDataSource.kt:106)
                 	at com.owncloud.android.data.spaces.repository.OCSpacesRepository.getSpaceWithSpecialsByIdForAccount(OCSpacesRepository.kt:67)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:33)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:27)
                 	at com.owncloud.android.domain.BaseUseCase.invoke(BaseUseCase.kt:30)
                 	at com.owncloud.android.presentation.files.filelist.MainFileListViewModel$updateSpace$1.invokeSuspend(MainFileListViewModel.kt:350)
                 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@75ce667, Dispatchers.IO]
12:08:33.981  E  FATAL EXCEPTION: DefaultDispatcher-worker-18
                 Process: com.owncloud.android.debug, PID: 32604
                 java.lang.NullPointerException: Parameter specified as non-null is null: method com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel, parameter <this>
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel(Unknown Source:2)
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource.getSpaceWithSpecialsByIdForAccount(OCLocalSpacesDataSource.kt:106)
                 	at com.owncloud.android.data.spaces.repository.OCSpacesRepository.getSpaceWithSpecialsByIdForAccount(OCSpacesRepository.kt:67)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:33)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:27)
                 	at com.owncloud.android.domain.BaseUseCase.invoke(BaseUseCase.kt:30)
                 	at com.owncloud.android.presentation.files.filelist.MainFileListViewModel$updateSpace$1.invokeSuspend(MainFileListViewModel.kt:350)
                 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@b6bac14, Dispatchers.IO]

Expected:

login view displayed with no crash

Pixel 2, Android 11
997ea67d

@jesmrec jesmrec added this to the 4.4 - Future milestone Jul 1, 2024
@GeorgeLifinRell
Copy link

I think I can work on that. Assign this to me and will submit a PR asap.

@JuancaG05
Copy link
Collaborator

Hi @GeorgeLifinRell! Thanks for your collaboration! Go for it, no need to have it assigned 😃

@jesmrec
Copy link
Collaborator Author

jesmrec commented Sep 27, 2024

@GeorgeLifinRell could you finally work on this? if you need any help from our side, just let us know. We are happy to help

@GeorgeLifinRell
Copy link

@jesmrec Thank you, I'm working on it, will update asap.

@GeorgeLifinRell
Copy link

https://demo.owncloud.org is not working. Is there any alternatives, so that it'll help me a lot.

@jesmrec
Copy link
Collaborator Author

jesmrec commented Sep 27, 2024

@GeorgeLifinRell

https://demo.owncloud.com
katherine/gemini

@GeorgeLifinRell
Copy link

I need more info about how to do this, since I'm new to such a huge codebase.

@JuancaG05
Copy link
Collaborator

Hi @GeorgeLifinRell! Well, it's difficult to explain the whole codebase as you said 😉, but my recommendation is first trying to reproduce the problem and get those logs posted in the issue, and from that point, going to the classes indicated in the logs, watching around, trying to identify the problem... At that point, if you have any problem just tell us 😀

@jesmrec jesmrec modified the milestones: 4.4 - Current, Backlog Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants