MarcusWolschon / osmeditor4android

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

Tags on new object are applied to the wrong object #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes Vespucci gets into some mode where any tags I try to add to a newly 
created object get applied to a different, previously created object instead, 
overwriting any tags that were on it previously. The object that I am trying to 
tag remains tagless.

I can't really reproduce it on demand but it has happened to me on multiple 
occasions and essentially makes the entire dataset invalid if you don't notice 
it right away. The only way to fix it is to load a new data set which means 
either uploading or discarding anything currently in memory.

I'm pretty sure it only happens if I interrupt an editing session by exiting 
the application or turning off the phone's screen for a while. But it doesn't 
always happen when I do this. It seems like maybe there is some variable that 
gets reset to 0 if Vespucci is unloaded from memory by the OS.

Vespucci 0.7.0 on a Samsung Vibrant (T-mobile version of Galaxy S) running the 
stock Android 2.2

Original issue reported on code.google.com by toby.mur...@gmail.com on 28 Oct 2011 at 7:24

GoogleCodeExporter commented 9 years ago
This has happened to me a few times now. I've found if i upload my other 
changes then try the tag edit again it seems happy.

0.70.0 on Archos 70 internet tablet

Original comment by jrhipk...@gmail.com on 29 Oct 2011 at 3:47

GoogleCodeExporter commented 9 years ago
I think I found and fixed the cause for this. OsmElementFactory wasn't 
serialized, while StorageDelegator and currentStorage/apiStorage were. Creating 
a few elements, closing the app and later restarting it resulted in existing 
elements with OsmId -1, -2, -3... and an OsmElementFactory ready to assign -1 
again. Once a new element was created, there were two elements with the same 
OsmId, resulting in a great mess (including this issue).

(Hopefully) fixed in the GSoC branch by making the ID counters non-static and 
serializing the factory together with currentStorage/apiStorage.

Original comment by janschej...@gmail.com on 11 Aug 2012 at 7:40

GoogleCodeExporter commented 9 years ago
I'm going to trust Jan's opinion that this has been fixed and close this. The 
suspected cause of this problem looks very reasonable. In any case, I've been 
unable to reproduce it.

Original comment by andrew.g...@gmail.com on 2 Sep 2012 at 11:22