MarcusWolschon / osmeditor4android

Vespucci is a OpenStreetMap editor for Android

Home Page:http://vespucci.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First time logging in to OSM - prompt doesn't dismiss after successful login

NeatNit opened this issue · comments

Vespucci Version

Vespucci 19.3.2

Download source

Play Store. (would have been F-Droid but aerial imagery built-in is too useful to pass up)

Device (Manufacturer and Model)

Samsung Galaxy S22+

Android Version

Android 14, OneUI 6.0

Behaviour/Symptoms

When successfully logging in to OSM to authorize Vespucci, the app doesn't dismiss the webview screen intended for logging in, leaving the user with nothing to do. The "Grant Access" button is available to be pressed a second time, which if pressed, causes a duplicate authorization which appears in OSM OAuth settings.
image

To get back to the app, the user must press Back twice.

Expected Behaviour

After successfully logging in and granting access, the user should immediately return to the upload screen or wherever it's supposed to land.

How to recreate

  1. Delete app's cache & data to reset all settings and forget any prior authorizations (note: I haven't found a way to log out through the app)
  2. Open the app, make an edit, try to upload - you'll be prompted to log into OSM
  3. Log in and grant access
Screen_Recording_20240107_040406_Vespucci_1.mp4

Crash dump submitted (no or yes + date)

No

Any other potentially relevant information

This isn't directly related, but OAuth1 is to be replaced with OAuth2 (#2401). If this happens soon enough, then this bug might not be relevant - just make sure it doesn't happen with the new implementation too.

Thanks for the report.

I've been working on #2469 the last couple of days so the relevant code has been exercised a lot. OAuth 2 support uses the same code for display and dismissing the login/grant webview and works without issues on google emulators running bog standard Android 14.

But I can recreate the issue on current Samsung devices so it is likely a relatively recent (as in the last year or so) issue with Samsungs webview implementation.

Two notes:

  • you can clear the authorisation state with "Reset OAuth" and manually restart the authorisation process with "Authorize OAuth" in the "Tools" menu, see http://vespucci.io/help/en/Main%20map%20display/#tools
  • the relationship between OAuth 2 and OAuth 1 is complicated and despite the "2" OAuth 2 is not actually an "improved" version of OAuth 1 and we will continue to support it at least for the foreseeable future in the app.

Thanks for those clarifications :)

Of course it's Samsung...

Of course it's Samsung...

They are probably not really to blame, it is just a subtle behaviour difference that took some digging to see what actually was broken (a 2nd instance of the activity gets created on the current Samsung devices which might even be arguably the correct behaviour). The fix is to ensure that this doesn't happen.

This is the second time in 2 months that I've reported a bug and it turned out to be something Samsung did differently from vanilla Android for no reason whatsoever. (This was the first: Julow/Unexpected-Keyboard#493 and it's definitely a change that only breaks stuff.)

Thanks for fixing! :)