jerboa icon indicating copy to clipboard operation
jerboa copied to clipboard

Jwt expired, login again fails

Open MV-GH opened this issue 1 year ago • 8 comments

When receiving, JWT expired snackbar with login again action, pressing it will redirect you to login. But on login it will fail with already logged in.

This case was expected and handled already be deleting it.

Backing out will show that is like current account is still that one that should be gone. Upon switching the account it seems to be fully gone and logging in again works.

This is very strange

MV-GH avatar Mar 04 '24 11:03 MV-GH

I've noticed this too, but only on voyager.lemmy.ml , is that where you're getting this?

dessalines avatar Mar 04 '24 15:03 dessalines

No, on another instance

MV-GH avatar Mar 04 '24 17:03 MV-GH

Somehow allAccounts = repository.allAccounts in accountViewModel still has the oldAccount for a while, it must not actually exist anymore because a simple swaps shows that it isn't listed anymore

MV-GH avatar Mar 04 '24 19:03 MV-GH

~Log:~ I was using an old version, ignore this.

type: crash
osVersion: google/oriole/oriole:14/UQ1A.240205.002/2024030300:user/release-keys
package: com.jerboa:50
process: com.jerboa
processUptime: 14097 + 200 ms

java.lang.IllegalStateException: You must either set a text or a view
	at com.android.internal.util.Preconditions.checkState(Preconditions.java:215)
	at android.widget.Toast.show(Toast.java:199)
	at com.jerboa.model.LoginViewModel$login$1.invokeSuspend(Unknown Source:637)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
	at kotlinx.coroutines.DispatchedTask.run(Unknown Source:109)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8279)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:49)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ab93c8c, Dispatchers.Main.immediate]

SievaFliesAlone avatar Mar 05 '24 14:03 SievaFliesAlone

What action did you do to get this exception? And thx for providing this stacktrace @anibyl

Are you still using Jerboa version 0.0.50?

This was fixed on 0.0.51 https://github.com/dessalines/jerboa/pull/1278

MV-GH avatar Mar 05 '24 15:03 MV-GH

@MV-GH yes, I'm using 0.0.50. Apparently F-Droid wasn't updating it because newer builds were signed by a different key?.. Will update today, thanks!

SievaFliesAlone avatar Mar 05 '24 15:03 SievaFliesAlone

The key hasn't changed, either you must have installed it from a different source (playstore or manually)

MV-GH avatar Mar 05 '24 16:03 MV-GH

I am getting closer to the cause, so the account actually gets deleted. But things observing the total accounts didn't get notified of this change. You can see that some parts did get notified (the account list, doesn't show anon option any more because we are anon, and thus also the action buttons will show 'require account') but account top header still shows the old title and the login viewmodel which uses repository.allAccounts still has the old account list info

https://github.com/dessalines/jerboa/assets/67873169/e23e0e2b-2d2b-47f2-b326-d5a3ec327d5b

MV-GH avatar Mar 06 '24 21:03 MV-GH