question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash when attempting to sign back in after session timeout

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ericdecaninicommented, Apr 11, 2022

This crash will be fixed in https://github.com/vector-im/element-android/pull/5398 which just needs a bit more testing before it can be merged

1reaction
Mikhail5555commented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Your session has expired, please l… | Apple Developer Forums
I can't login.. after entering valid login/pw it immediately says "Your session has expired. Please log in. Try signing in again or contact...
Read more >
web page crashes after sleep mode - MSDN - Microsoft
I have a web page that works fine as long as the pc does not go into sleep mode. The page uses some...
Read more >
Xcode export/upload error: Your session has expired. Please ...
The session of one of my accounts (not even the one I was trying to use) had its session expired. This seems to...
Read more >
Your Session Has Timed Out - Coding Horror
You have to manually log in again, remember what you were doing, ... If they try to continue a session after the re-auth...
Read more >
Android: "Session Timed Out" on 2204.1 - Pandora Community
Android: "Session Timed Out" on 2204.1 ... the we're currently having technical problems after attempting to log back in. ... 30 minutes of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found