osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.65k stars 1.02k forks source link

Geo share cause tracks to duplicate #14021

Closed stevenroose closed 1 year ago

stevenroose commented 2 years ago

Description

I realize this report is quite random and strange. But I recently did an update and updated some maps and I noticed map rendering slowed down *significantly. To the point that I had to wait 10 seconds for a bit more map to load and I just couldn't use the app anymore. I thought it was a bug in the update and waited several days for a fix, but didn't happen.

I wanted to report the issue, but I first wanted to see if I perhaps enabled some new features or so. I disabled shadows and contour lines and it improved, but not entirely.

Then I noticed I had "98xx tracks shown". I occasionally record a track but not 10 thousand. I opened the track list and just my own 10 tracks were there. I flipped the tracks flipswitch off and the rendering delay disappeared. When I flipped the switch back on, it said only my own "10 tracks shown" and rendering was fine.

So somehow, I didn't try importing anything that I remember, a ton of tracks showed up and totally ruined rendering speed..

How to reproduce?

Absolutely no idea..

Your Environment

OsmAnd Version: 4.1.11 Android/iOS version: Android 9, Oxygen 9.0.2 Device model: OnePlus 6

Maps used (online or offline):
I use the offline vector maps and I have a bunch of zones downloaded. I can provide the full list if that might be relevant.

vmicho commented 2 years ago

I can confirm. I have same version and android 11. It happens (slow down to a slug) during recording. My observations:

For me this looks like the app treats the recorded points (or sets of points) as tracks (just my idea)

I've found an older screenshot to illustrate the marker selection:

rafalwlo commented 2 years ago

vmicho commented 2 years ago

Update: I've found in the Menu->Configure Map->Tracks that it shows 4042 tracks (which I definitely do not have physically). After disabling the only one that was checked, the counter fell down to 0 or 1. Now it seems stable during recording. I'll update if/when the problem reproduces (might take 1-3 months).

vmicho commented 2 years ago

Well. I can finally reproduce in quite stable way.

Looks like it does not come from normal usage, but from external app asking to show position. Every time osmand is opened for position, the number of shown tracks roughly doubles.

My scenario includes Simple Gallery Pro app (should work also with Simple Gallery, you can get Simple Gallery Pro easily from F-droid like me):

scaidermern commented 2 years ago

Looks like it does not come from normal usage, but from external app asking to show position. Every time osmand is opened for position, the number of shown tracks roughly doubles.

Indeed, I can reproduce this (with OsmAnd 4.2.2). Stopping and restarting OsmAnd doesn't fix the visible tracks counter.

vmicho commented 2 years ago

Update: Still happens in osmand+ 4.2.4 2022-06-15

vmicho commented 2 years ago

Update: With over "200000" tracks displayed, I cannot even turn them off. Turning off markers also does nothing. Also Osmand takes a lot of CPU. Also as before it slows down to a crawl until even the android dialog for non-responding app appears.

Even after removing the app from task manager, it still runs! :

image

Can be only removed by killing the process, needs root:

dipper:/ $ su
dipper:/ # killall net.osmand.plus
scaidermern commented 2 years ago

Still no milestone set? Several users reported serious performance issues with OsmAnd due to this bug. I think it should get a higher priority. A fix is probably not very hard.

vshcherb commented 2 years ago

Still no milestone set? Several users reported serious performance issues with OsmAnd due to this bug. I think it should get a higher priority. A fix is probably not very hard.

Why users would have over 9000 tracks displayed? It sounds very personal issue. If we talk about heatmap or large collection of GPX it should be converted to OBF file which can support 100 000 of lines

vmicho commented 2 years ago

It's not that user have 9000 or 200000 tracks on device. The issue is that osmand displays so many tracks even when they are not there physically. And every further normal usage (like restarting app, choosing tracks to display, ...) increases that number exponentially when the bug occurs ... until the app is not responding.

So this should be marked as major bug because it causes app crash, app not responding dialog (maybe a report to google), and user backlash ... (I am just really unsure which one is worse)

vshcherb commented 2 years ago

Please post the simplest you know scenario how to get tracks replicated.

scaidermern commented 2 years ago

Please post the simplest you know scenario how to get tracks replicated.

Tap on the map. Share the position. Select OsmAnd for opening. Now the number of displayed tracks has increased. Repeat.

vmicho commented 2 years ago

Hi. I described it in few comments above: https://github.com/osmandapp/OsmAnd/issues/14021#issuecomment-1145330641

After several thousands tracks are reported as shown, then the number increases by itself just by using the app (adding markers, show/disable tracks on map, restarting app, adding new tracks by tracking, ...)

vshcherb commented 2 years ago

Tried in the latest nightly couldn't reproduce so far.

vmicho commented 2 years ago

Do you have few tracks active + currently recording track? Not sure if it will work from 0. Also try to reproduce first on some of the released versions.

scaidermern commented 2 years ago

Tried in the latest nightly couldn't reproduce so far.

I can reproduce it with the nightly 4.3.0#34323m. See how the number of displayed tracks increases:

https://user-images.githubusercontent.com/1040784/177255883-351129db-b818-431a-98a2-6923909fce7d.mp4

Zirochkabila commented 2 years ago

The case was tested with OsmAnd 4.3.0#13626mqta, released: 2022-07-05, and OsmAnd 4.2.6, released: 2022-06-29 - it succeeded, the number of tracks increased

Steps to reproduce

Configure map > Tracks > Show current track (THIS IS A BASIC CONDITION TO REPRODUCE THE BUG) > a long press on the map > Share > geo: > Select OsmAnd > Configure map > The number of tracks has increased

Environment

OsmAnd Version: 4.3.0#13626mqta, released: 2022-07-05 / 4.2.6, released: 2022-06-29 Android/iOS version: Android 11 Device model: POCO X3 NFC

https://user-images.githubusercontent.com/104760013/177292289-98411733-38eb-45b7-9e43-c16cc3468942.mp4

Discostu36 commented 2 years ago

Please fix this bug. For me Osmand has been nearly impossible to use for weeks until I found out (with help from the guys from the telegram channel) that I had 1024 (not physically existing) tracks that were displayed on the map. This bug affects every user who often opens geo: links with Osmand. it should not be ignored for months.