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

Upload failure on Marshmallow #68

Closed
begbiemark opened this issue Apr 10, 2016 · 11 comments
Closed

Upload failure on Marshmallow #68

begbiemark opened this issue Apr 10, 2016 · 11 comments

Comments

@begbiemark
Copy link

When I touch the button to upload a track to Openstreetmap, the app instead performs an address search and then shows the map at 0.00 lat by 0.00 long. I am using an SGS 7 Edge running Marshmallow.

@nguillaumin
Copy link
Contributor

Hi, any chance you could take a few screenshots?

@begbiemark
Copy link
Author

Sorry for the delay. However, I don't know how much use they will be TBH.

Go into the track list
2016-04-11 19 29 11

Open a track
2016-04-11 19 29 29

Touch on 'MORE' and then 'OpenStreetMap upload' in the drop-down menu
2016-04-11 19 30 51

Once tagged, touch 'SAVE AND UPLOAD'
2016-04-11 19 31 04

Then get taken to a map with a pin at 0 Lat by 0 Long
2016-04-11 19 31 10

Info screen for version
2016-04-11 19 32 32

@begbiemark
Copy link
Author

I realised that I don't remember OSMTracker ever asking me for my OSM credentials since installing on my new phone with Marshmallow. I uninstalled and reinstalled just to see, and sure enough no request for OSM login credentials. Curiously the Settings doesn't seem to have any option to enter these, and the option to force their re-input is greyed out.
2016-04-14 19 16 46

@nguillaumin
Copy link
Contributor

Thanks, that's odd. The "reset" menu is greyed out if credentials are not already stored so that makes sense, but I'm not sure why it doesn't prompt you for them. I think other people are using it successfully on Marshmallow so I'm not sure what's different here.

Unfortunately that will probably be difficult to reproduce if it only happens with this specific phone model or something. Do you think you'd be able to install the dev tools and run the app through the debugger?

@begbiemark
Copy link
Author

Hi there,

Can give the Feb tools a go, but you'll need to point me to some instructions.

Is there any way to force the app to request credentials when there are none stored?

Out of curiosity, when should it have asked for them?

Thanks,

M

On 15 April 2016 10:41:39 BST, nguillaumin notifications@github.com wrote:

Thanks, that's odd. The "reset" menu is greyed out if credentials are
not already stored so that makes sense, but I'm not sure why it doesn't
prompt you for them. I think other people are using it successfully on
Marshmallow so I'm not sure what's different here.

Unfortunately that will probably be difficult to reproduce if it only
happens with this specific phone model or something. Do you think you'd
be able to install the dev tools and run the app through the debugger?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#68 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@nguillaumin
Copy link
Contributor

Hi,

It's not the best time for me as I'm in the middle of an overseas relocation and it's actually been a while since I used the tools, so I won't be able to give detailed instructions but you can try to start from there: http://developer.android.com/sdk/index.html

Perhaps the easiest thing to start with is to install the command line tools and use adb logcat to display the logs while the app is running on your phone.

Is there any way to force the app to request credentials when there are none stored?

That's the thing, it's already supposed to do that

Out of curiosity, when should it have asked for them?

When you press the "Save & upload" button it's supposed to check if you have a token and a secret, and if one of them is missing it's supposed to ask them again (as per the line of code above)

Nico

@chillly
Copy link

chillly commented Apr 15, 2016

No prompt for osmid for me either. G. nexus 6p with Marshmallow

@begbiemark
Copy link
Author

SOLVED.

The problem is to do with the way Marshmallow is handling default actions. When paying the upload button, OSMTracker passes an OSM URL for checking credentials. However, Marshmallow in its infinite wisdom decides it knows better and uses OSMAnd to handle the link. Not surprisingly, OSMAnd had no idea what to do with it.

The solution is to clear the actions OSMAnd is used as default for, you will then be presented with the option to authenticate.

Sadly it seems in Marshmallow you need to go in and clear defaults for apps, then specifically tell the OS to ask each time. Otherwise the default is to act as if an invisible "always take this action" button is ticked the first time you select a particular app to handle an event.

On 15 April 2016 13:26:15 BST, nguillaumin notifications@github.com wrote:

Hi,

It's not the best time for me as I'm in the middle of an overseas
relocation and it's actually been a while since I used the tools, so I
won't be able to give detailed instructions but you can try to start
from there: http://developer.android.com/sdk/index.html

Perhaps the easiest thing to start with is to install the command line
tools
and use
adb logcat to display the logs while the app is running on your
phone.

Is there any way to force the app to request credentials when there
are none stored?

That's the thing, it's already supposed to do
that

Out of curiosity, when should it have asked for them?

When you press the "Save & upload" button it's supposed to check if you
have a token and a secret, and if one of them is missing it's supposed
to ask them again (as per the line of code above)

Nico


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#68 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@crazycaveman
Copy link

I am able to replicate this on Lollipop, 5.1.1, with my LG Leon. From what I can tell, it is due to the fact that OSMAnd advertises that it can handle OSM URIs (it has done this for some time) and, if you tell it to always open those URIs, you'll encounter this bug. It might be that Marshmallow makes it less clear that you are making it always be the default. Would using a webview in OSMTracker help fix this issue?

@nguillaumin
Copy link
Contributor

Thanks guys that's a nice finding.

I think I can pinpoint it in OsmAnd in this file: https://github.com/osmandapp/Osmand/blob/d9f7ac5a50d90e4175322939ecad615dc4b0f634/OsmAnd/AndroidManifest.xml#L220

As I understand it it's for OsmAnd to open when somebody clicks on an OpenStreetMap link, to display the map in OsmAnd rather than in the browser. The problem I believe is that capturing URLs on the host only is a bit too broad as it will also capture OpenStreetMap URLs that don't point to a map, such as /oauth/ and others (e.g. /api/, etc.)

A good fix I believe would be to narrow down the intent filter in OsmAnd to what OsmAnd is really interested it (I assume only displaying a map). CC'ing some OsmAnd contributors to see if that would work? @vshcherb ?

@begbiemark
Copy link
Author

I've now learned that it's not Marshmallow per see, that was the cause. But rather that Samsung has taken out the option to choose once or always when you open a link type for the first time. So I had no idea Osmand had been set as default for these links and was therefore being selected as handler.

So a big "thank you" to Samsung. If I wanted to be treated like a simpleton, I'd be on iOS :-)

On 18 May 2016 23:30:23 BST, nguillaumin notifications@github.com wrote:

Thanks guys that's a nice finding.

I think I can pinpoint it in OsmAnd in this file:
https://github.com/osmandapp/Osmand/blob/d9f7ac5a50d90e4175322939ecad615dc4b0f634/OsmAnd/AndroidManifest.xml#L220

As I understand it it's for OsmAnd to open when somebody clicks on an
OpenStreetMap link, to display the map in OsmAnd rather than in the
browser. The problem I believe is that capturing URLs on the host only
is a bit too broad as it will also capture OpenStreetMap URLs that
don't point to a map, such as /oauth/ and others (e.g. /api/, etc.)

A good fix I believe would be to narrow down the intent filter in
OsmAnd to what OsmAnd is really interested it (I assume only displaying
a map). CC'ing some OsmAnd contributors to see if that would work?
@vshcherb ?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#68 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants