MarcusWolschon / osmeditor4android

Vespucci is a OpenStreetMap editor for Android
http://vespucci.io
Other
373 stars 83 forks source link

Save incomplete GPX Tracks #1381

Closed vespucci-reporter closed 3 years ago

vespucci-reporter commented 3 years ago

Description:

A few times I have started a GPX track and paused it to continue later or to upload when I have signal. If I close the app or don't restart the tracking for a long time I lose my data. When running a GPX tack can you please save the data to storage when paused and also auto-save points so data is not losted?

Device info:

App version15.2.1.0
App version code1703
Android build versionG930FXXU8ETI2
Android release version8.0.0
Android SDK version26
Android build IDR16NW.G930FXXU8ETI2
Device brandsamsung
Device manufacturersamsung
Device nameherolte
Device modelSM-G930F
Device product nameheroltexx
Device hardware namesamsungexynos8890
ABIs[arm64-v8a, armeabi-v7a, armeabi]
ABIs (32bit)[armeabi-v7a, armeabi]
ABIs (64bit)[arm64-v8a]

Extra info:

OSM display namedeanleggo
simonpoole commented 3 years ago

We do save the track to device storage when you pause tracking and if you terminate the app it is restored when you restart. In particular in the later case as long as the app isn't running nothing is going to or be able to remove the recording.

So the behaviour you are seeing needs to be narrowed down a bit so that we can determine if there is a bug or other issue. How long is "don't restart the tracking for a long time" ?

deanleggo commented 3 years ago

I provided fedback via the app and saw it uploaded it to Github. Thanks for the fast reply. @simonpoole what you describe is what should happen and happens most of the time but a dozen or so times, some of my GTX tracks have been lost.

If I pause tracking I'll classify this as a session. I can have multiple sessions before 'Clear GPX track and its waypoints'. Usually I'll upload the waypoints to the OSM server before clearing.

How long is "don't restart the tracking for a long time" ?

I 'Pause GPX tracking' and go to the home screen, the app is in the app draw, so not closed (I'm not too sure what Android classifies this as). Then an hour or two later I 'Start GPX track' again. Some times the previous session of GPX tracking is lost, but not all sessions are lost.

The last time I lost a session I was out-of-range of mobile signal, I recorded a track and hit pause and then locked my phone. I unlocked my phone and used OsmAnd to navagate. Later that night (I had closed all apps) I opened Vespucci and uploaded the data. I then realised the waypoints contained data from a session at a lighthouse (previous day) but not the session I recorded earlier today.

I do have Bing aerial imagery enabled (the only change I have made for the default) and I previously had issues with the app failing to launch. But lost tracks do not coinside when the app failed to launch. I'll try and test when I loss data to try and narrow down where the bug may be and I hope this helps.

simonpoole commented 3 years ago

Note: you can always export the current track to stay on the safe side while experimenting.

deanleggo commented 3 years ago

Over the last two days I tested recording tracks. So the issue is when I quit the app, I loss some or all of the waypoints from a GPX track. I lost tracking data every time I quit the app. Starting, pausing, or closing the app does not loss any data. It does not matter if I exported, uploaded, or nothing. When I quit some data is lost. Usually a sesson is lost, but once only half a session was lost.

Every time I recorded a track I had Bing images visible and have not downloaded the current view I am recording in. Over the next few days I'll try recording with Bing images disabled and/or I'll download the current view I am recording in and see if that changes the issue.

simonpoole commented 3 years ago

Bing imagery defintely won't influence this (there was a regression a couple of releases back with retrieving Bing metadata when the device didn't have network connectivity but that has long been fixed and wouldn't have any bearing on this issue in any case).

As clarification what do you mean with "quit" the app vs. "close"?

deanleggo commented 3 years ago

Close (stopped state) is when I click on the home button or switch to another app. Quit (destoryed state) is when I swipe the app in the app draw to terminate the app.

Edit: read up on Android Activity states

simonpoole commented 3 years ago

Close (stopped state) is when I click on the home button or switch to another app. Quit (destoryed state) is when I swipe the app in the app draw to terminate the app.

There is no guarantee that terminating the app via the app drawer does anything except that, it's essentially a force close, if you want to cleanly exit Vespucci you should press the back button (while on the main screen).

deanleggo commented 3 years ago

Okay, I thought the only way to force close an app is via the settings>app page. That probably also kills all the background services.

Clicking back, the app comes up with a confirmation box and closes. But the app is still in the app draw. So far this fixes the issue, but I think it'll be good if there is a way to not have to click back to make sure the track data is saved.

simonpoole commented 3 years ago

Tentatively fixed in https://github.com/MarcusWolschon/osmeditor4android/commit/acc30a8d161dad2de81e525e42a8656fd84b56a8

simonpoole commented 3 years ago

@deanleggo have you been able to test against the current version (15.2.2) from the play store?

simonpoole commented 3 years ago

Stale, closing.