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.

Logout doesn't immediately log users out

See original GitHub issue

Summary: When I logout of the app, I see a “Please wait” loading dialog. After the dialog disappears, I expect to see the log-in page but it doesn’t show up. The dialog just disappears and I’m able to use the app as if nothing happened. I’m not able to upload images, though. When I close the app and re-open it I see the login page.

Steps to reproduce:

  1. Open the app
  2. Log in to the app
  3. Log out using the “Log out” option in the side bar menu

I expect to see the log-in screen after that.

System logs: I’m not sure if they are of any use but here are the logs I could get:

V/ActivityThread(26553): updateVisibility : ActivityRecord{1bb6898c token=android.os.BinderProxy@3bbe2786 {fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}} show : false
D/ActivityManager(  754):  Launching fr.free.nrw.commons, updated priority
D/LocationManagerService(  754): request 3fea43f4 network Request[POWER_LOW network requested=+12s0ms fastest=+12s0ms] from fr.free.nrw.commons(10578)
D/LocationManagerService(  754): request 3fea43f4 gps Request[ACCURACY_FINE gps requested=+12s0ms fastest=+12s0ms] from fr.free.nrw.commons(10578)
E/ContributionsFragment(26553): onFragmentResumed fr.free.nrw.commons.contributions.ContributionsListFragment
E/BufferQueueCore(  188): [fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity] setDefaultMaxBufferCount: setting count to 3, previous is 2
D/StatusBarManagerService(  754): manageDisableList userId=0 what=0x0 pkg=Window{f81301a u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}
V/WindowStateAnimator(  754): Finishing drawing window Window{f81301a u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: mDrawState=DRAW_PENDING
I/Timeline(  754): Timeline: Activity_windows_visible id: ActivityRecord{853b999 u0 fr.free.nrw.commons/.contributions.MainActivity t39860} time:129081857
V/WindowManager(  754): not Base app: Adding window Window{3fccd2bf u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity} at 10 of 14
D/StatusBarManagerService(  754): manageDisableList userId=0 what=0x0 pkg=Window{3fccd2bf u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}
E/BufferQueueCore(  188): [fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity] setDefaultMaxBufferCount: setting count to 3, previous is 2
V/WindowStateAnimator(  754): Finishing drawing window Window{3fccd2bf u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: mDrawState=DRAW_PENDING
V/WindowStateAnimator(  754): Finishing drawing window Window{3fccd2bf u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: mDrawState=HAS_DRAWN
V/WindowManager(  754): not Base app: Adding window Window{3205dbdb u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity} at 11 of 15
W/System.err(26553): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/cache/okhttp-cache/99ec56b47be5d8d13a33c691c3ef9da3.0
W/System.err(26553): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/cache/okhttp-cache/99ec56b47be5d8d13a33c691c3ef9da3.1
E/BufferQueueCore(  188): [fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity] setDefaultMaxBufferCount: setting count to 3, previous is 2
V/WindowStateAnimator(  754): Finishing drawing window Window{3205dbdb u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: mDrawState=DRAW_PENDING
V/WindowStateAnimator(  754): Finishing drawing window Window{3205dbdb u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: mDrawState=HAS_DRAWN
W/System.err(26553): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/cache/okhttp-cache/99ec56b47be5d8d13a33c691c3ef9da3.0
W/System.err(26553): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/cache/okhttp-cache/99ec56b47be5d8d13a33c691c3ef9da3.1
D/StatusBarManagerService(  754): manageDisableList userId=0 what=0x0 pkg=Window{f81301a u0 d0 fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}
I/ActivityManager(  754): Start proc 31146:fr.free.nrw.commons:auth/u0a578 for service fr.free.nrw.commons/.auth.WikiAccountAuthenticatorService
W/ResourcesManager(31146): getTopLevelResources: /data/app/fr.free.nrw.commons-1/base.apk / 1.0 running in fr.free.nrw.commons rsrc of package null
I/ACRA    (31146): ACRA is enabled for fr.free.nrw.commons, initializing...
W/System.err(31146): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/shared_prefs/fr.free.nrw.commons_preferences.xml.bak
W/System.err(31146): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/shared_prefs/MapboxSharedPreferences.xml.bak
D/SoLoader(31146): adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/fr.free.nrw.commons-1/lib/arm flags = 0]
D/SoLoader(31146): adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/fr.free.nrw.commons/lib-main flags = 1]
D/SoLoader(31146): Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/fr.free.nrw.commons-1/lib/arm flags = 0]
D/SoLoader(31146): Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/fr.free.nrw.commons/lib-main flags = 1]
V/fb-UnpackingSoSource(31146): locked dso store /data/data/fr.free.nrw.commons/lib-main
V/fb-UnpackingSoSource(31146): releasing dso store lock for /data/data/fr.free.nrw.commons/lib-main (from syncer thread)
V/fb-UnpackingSoSource(31146): not releasing dso store lock for /data/data/fr.free.nrw.commons/lib-main (syncer thread started)
D/SoLoader(31146): libmapbox-gl.so not found on /data/data/fr.free.nrw.commons/lib-main
D/SoLoader(31146): libmapbox-gl.so found on /data/app/fr.free.nrw.commons-1/lib/arm
V/AlarmManagerEXT(  754): <AccPackages> fr.free.nrw.commons
E/SQLiteLog(26553): (28) file unlinked while open: /data/data/fr.free.nrw.commons/databases/commons.db
W/System.err(26553): remove failed: ENOENT (No such file or directory) : /data/data/fr.free.nrw.commons/cache/image_cache/v2.ols100.1

Device and Android version: Samsung SM-J111F, Android 5.1.1

Commons app version: 2.12.3.623

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
madhurgupta10commented, Apr 12, 2020

@sivaraam @macgills What I found out that particularly updateAllDatabases(); in

sessionManager.logout()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(() -> {
                    Timber.d("All accounts have been removed");
                    clearImageCache();
                    //TODO: fix preference manager
                    defaultPrefs.clearAll();
                    defaultPrefs.putBoolean("firstrun", false);
                    updateAllDatabases();
                    logoutListener.onLogoutComplete();
                });

is responsible for the delay!

The reason seems to be due to this Exception - Cannot access database on the main thread since it may potentially lock the UI for a long period of time.

1reaction
misaochancommented, Sep 24, 2020

Thanks for pointing me to this issue, should be fixed by #3649 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logout does not log user out - Auth0 Community
Logout link does not log user out. The link works, goes to the /out.html page, but when I type into url: /home (or...
Read more >
New/existing user login and logout right away - can't log into
I have an issue with Windows 10 Pro 2004 on laptop HP EliteBook 840 G6. I have a local adm account. I'm able...
Read more >
Signout does not logout user when session is being requested ...
Steps to reproduce: Open the example project in two different tabs. Log in to the app. Sign out of the app then immediately...
Read more >
FormsAuthentication.SignOut() does not log the user out
SignOut () and they are authenticated on every new request. In MS documentation is says that cookie will be cleared but they don't,...
Read more >
Solving the logout problem properly and elegantly - InfoWorld
Many Web applications do not contain overly confidential and ... a page asking the user to confirm that she indeed wants to log...
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