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

Crash when attempting to sign back in after session timeout #5701

Closed
sevmonster opened this issue Apr 6, 2022 · 9 comments
Closed

Crash when attempting to sign back in after session timeout #5701

sevmonster opened this issue Apr 6, 2022 · 9 comments
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@sevmonster
Copy link

sevmonster commented Apr 6, 2022

Steps to reproduce

  1. Set a low session_lifetime on the homeserver.
  2. Let the app be logged out.
  3. Reopen Element and attempt to sign in.

Outcome

What did you expect?

Redirected to sign-in flow (password, SSO, etc.)

What happened instead?

Open app, presented with "You're signed out" flow, attempting to sign back in crashes. Can't rageshake, can't access any other screen. Clearing app data allows to sign in again, either in-app with the second button or in settings.
Resized_Screenshot_20220405-214504_Element(1)_1

(note that even though SSO is the only auth method enabled right now as shown in the picture, this also happened when passwords were enabled earlier in the homeserver's lifetime, if I recall.)

FATAL EXCEPTION: main
Process: im.vector.app, PID: 24571
java.lang.IllegalStateException: Developer error
	at im.vector.app.features.login.LoginActivity$onSignModeSelected$1.invoke(LoginActivity.kt:14)
	at im.vector.app.features.login.LoginActivity$onSignModeSelected$1.invoke(LoginActivity.kt:1)
	at com.airbnb.mvrx.StateContainerKt.withState(StateContainer.kt:1)
	at im.vector.app.features.login.LoginActivity.onSignModeSelected(LoginActivity.kt:1)
	at im.vector.app.features.login.LoginActivity.handleLoginViewEvents(LoginActivity.kt:23)
	at im.vector.app.features.login.LoginActivity.access$handleLoginViewEvents(LoginActivity.kt:1)
	at im.vector.app.features.login.LoginActivity$initUiAndData$2.invoke(LoginActivity.kt:2)
	at im.vector.app.features.login.LoginActivity$initUiAndData$2.invoke(LoginActivity.kt:1)
	at im.vector.app.core.platform.VectorBaseActivity$observeViewEvents$1.invokeSuspend(VectorBaseActivity.kt:3)
	at im.vector.app.core.platform.VectorBaseActivity$observeViewEvents$1.invoke(Unknown Source:8)
	at im.vector.app.core.platform.VectorBaseActivity$observeViewEvents$1.invoke(Unknown Source:4)
	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:6)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect(SharedFlow.kt:12)
	at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:10)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:14)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:6)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:4)
	at kotlinx.coroutines.flow.SharedFlowImpl.tryEmit(SharedFlow.kt:6)
	at im.vector.app.features.login.LoginViewModel.handle(LoginViewModel.kt:18)
	at im.vector.app.features.signout.soft.SoftLogoutFragment$signinFallbackSubmit$1.invoke(SoftLogoutFragment.kt:2)
	at im.vector.app.features.signout.soft.SoftLogoutFragment$signinFallbackSubmit$1.invoke(SoftLogoutFragment.kt:1)
	at com.airbnb.mvrx.StateContainerKt.withState(StateContainer.kt:1)
	at im.vector.app.features.signout.soft.SoftLogoutFragment.signinFallbackSubmit(SoftLogoutFragment.kt:1)
	at im.vector.app.features.signout.soft.SoftLogoutController$buildForm$4$1.invoke(SoftLogoutController.kt:2)
	at im.vector.app.features.signout.soft.SoftLogoutController$buildForm$4$1.invoke(SoftLogoutController.kt:1)
	at im.vector.app.core.epoxy.ListenerKt$$ExternalSyntheticLambda0.onClick(R8$$SyntheticClass:1)
	at im.vector.app.core.utils.DebouncedClickListener.onClick(DebouncedClickListener.kt:5)
	at android.view.View.performClick(View.java:6597)
	at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:2)
	at android.view.View.performClickInternal(View.java:6574)
	at android.view.View.access$3100(View.java:778)
	at android.view.View$PerformClick.run(View.java:25906)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6718)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Restarting Synapse, the affected apps, and the devices; and clearing cache did not help. Web and desktop users do not have this issue to our knowledge and are able to sign in after being signed out.

Your phone model

Samsung Galaxy Z Flip, Sony Xperia XA1

Operating system version

Android 10, 8

Application version and app store

Element 1.4.4, olm 3.2.10, Google Play and F-Droid versions

Homeserver

Synapse 1.55.2

Will you send logs?

Can't rageshake, so can't send logs.

@sevmonster sevmonster added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Apr 6, 2022
@sevmonster
Copy link
Author

sevmonster commented Apr 6, 2022

So I just discovered another user got signed out of their Android and web version at the same time, and stayed signed in on the web on another device.
matrix-org/synapse#12397

Turns out that was my fault. This issue is still relevant however.

@sevmonster sevmonster changed the title "You're signed out" happens to multiple users and crash when attempting to sign back in Crash when attempting to sign back in after session timeout Apr 6, 2022
@mikhail5555
Copy link

I am also experiencing the same errors (On pretty much all android Matrix clients (Elements, SchildiChat, FluffyChat)). If there is any help (in logs that i can provide) please let me know.

The minimum viable setup is as following:
Enable an oidc_providers
Disable enable_registration
Disable password_config.enabled

Set session token on short expiry time (not sure about this step)
Otherwise wait 1-2 days until you see that You're signed out screen, click on Continue with SSO -> App crash with Developer Error or Invalid State error.

@sevmonster
Copy link
Author

Invalid State error.

I also saw that one at one point but forgot, thank you.

Did you ever experience it with password sign in or just SSO? Unless my memory is failing me I do remember experiencing this with password login (though I did have SSO enabled at the same time).

@mikhail5555
Copy link

@sevmonster I have explicitly SSO enabled. (Password login completely disabled)

@ericdecanini
Copy link
Contributor

This crash will be fixed in #5398 which just needs a bit more testing before it can be merged

@mikhail5555
Copy link

This crash will be fixed in #5398 which just needs a bit more testing before it can be merged

if you want me to test it locally, let me know

@ericdecanini
Copy link
Contributor

ericdecanini commented Apr 12, 2022

This crash will be fixed in #5398 which just needs a bit more testing before it can be merged

if you want me to test it locally, let me know

Please do, that would be great! If you could also let me know what login style (password / sso) you get after the soft logout happens, that would be perfect

@mikhail5555
Copy link

mikhail5555 commented Apr 12, 2022

This crash will be fixed in #5398 which just needs a bit more testing before it can be merged

if you want me to test it locally, let me know

Please do, that would be great! If you could also let me know what login style (password / sso) you get after the soft logout happens, that would be perfect

Is there some artifact from a pipeline i can use for the apk? or how would i acquire it?
edit: ignore this question, already found it

@bmarty
Copy link
Member

bmarty commented May 11, 2022

Seems it's been fixed by #5398, else please re-open the issue!

@bmarty bmarty closed this as completed May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

4 participants