Modify

Opened 9 years ago

Last modified 5 years ago

#12483 reopened defect

Should not silently delete layers with upload=false

Reported by: naoliv Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

I was editing some data and manually changed upload='true' to upload='false' in the osm file, to avoid uploading it unintentionally (while the tracing and everything else wasn't complete yet).

Then, I pressed Delete, thinking that I had one object selected, but actually had the data layer selected.
And JOSM silently deleted the layer...

JOSM should also warn that the layer has modified data, even if it has upload='false'.

It should, of course, not offer to upload the data, but should give a warning and option to save it, instead silently deleting the layer.

JOSM:

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-02-01 23:47:27 +0100 (Mon, 01 Feb 2016)
Build-Date:2016-02-02 02:32:58
Revision:9711
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9711 pt_BR) Linux Debian GNU/Linux unstable (sid)
Memory Usage: 1040 MB / 3641 MB (804 MB allocated, but free)
Java version: 1.8.0_72-internal-b15, Oracle Corporation, OpenJDK 64-Bit Server VM
VM arguments: [-Dawt.useSystemAAFontSettings=on]
Dataset consistency test: No problems foundURL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-02-01 23:47:27 +0100 (Mon, 01 Feb 2016)
Build-Date:2016-02-02 02:32:58
Revision:9711
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9711 pt_BR) Linux Debian GNU/Linux unstable (sid)
Memory Usage: 1040 MB / 3641 MB (804 MB allocated, but free)
Java version: 1.8.0_72-internal-b15, Oracle Corporation, OpenJDK 64-Bit Server VM
VM arguments: [-Dawt.useSystemAAFontSettings=on]
Dataset consistency test: No problems found

Attachments (3)

test.osm (156.9 KB ) - added by naoliv 7 years ago.
video.ogv (3.1 MB ) - added by naoliv 7 years ago.
delete-layer.ogv (113.3 KB ) - added by naoliv 7 years ago.

Change History (11)

comment:1 by Klumbumbus, 9 years ago

I think we already have a ticket for this, but I cannot find it. ticket:10832#comment:2

Last edited 9 years ago by Klumbumbus (previous) (diff)

comment:2 by Don-vip, 7 years ago

Resolution: worksforme
Status: newclosed

I tested several ancient versions up to r9329 and it works as expected, you get the warning when deleting an upload=false layer with unsaved data. But the flag has to be set before opening the file!

by naoliv, 7 years ago

Attachment: test.osm added

by naoliv, 7 years ago

Attachment: video.ogv added

comment:3 by naoliv, 7 years ago

Resolution: worksforme
Status: closedreopened

I can reproduce the problem. Not always nor in a scientific way, but I can.
Open the attached example file. Draw some area just for test.

What I could observe is that if I select the layer at 1 and then click at 2 to unselect it, sometimes JOSM allows me to delete the layer without any warning:

https://i.imgur.com/RBoxa6K.png

If I click at 1 to select the layer, then at 2, then I press the Delete key, the layer gets deleted without any message.

See in the attached video also. I was trying to delete the layer and JOSM kept asking to save or upload it. But one time it just deleted it, without any warning.

Version 0, edited 7 years ago by naoliv (next)

in reply to:  3 comment:4 by Don-vip, 7 years ago

Replying to naoliv:

clicking at 1 and then clicking at 2 to unselect it

This is odd. Only with Metal look-and-feel, or also with GTK? With Windows l&f, clicking on 2 does not unselect the layer. But even with Metal, I cannot unselect the layer.

Last edited 7 years ago by Don-vip (previous) (diff)

comment:5 by naoliv, 7 years ago

With GTK I can reproduce the same behavior: sometimes JOSM allows to delete the layer without asking anything.

And this thing will be hard to explain, I guess :-)
While visually the layer is selected, if seems/feels that it "unselects" it.
Maybe you can see this if you download multiple times the same area as new layers. Select one layer and keep pressing Delete.
Sometimes JOSM selects the next layer and allows you to also delete it. Sometimes it just stops to delete the layer.

See the new example video, where I have downloaded the same area 12 times, without modifying anything.
If I select the first downloaded layer (Data Layer 1) and delete it, JOSM focus at the top layer (Data Layer 12); if I press Delete again, JOSM deletes it and focus at the next one (Data Layer 11). If I press Delete again JOSM doesn't delete the layer (as if it is not selected anymore)

by naoliv, 7 years ago

Attachment: delete-layer.ogv added

comment:6 by mdk, 5 years ago

It looks like this problem is fixed together with #17350

I load the attached {{test.osm}} file and do a modification. After selecting the layer and pressing {{delete}} or use the {{Delete selected Layer}} action, the "Unsaved changes" dialog pops up with upload=false and save=true.

comment:7 by mdk, 5 years ago

The problem that sometimes delete cause the expected warning dialog and sometimes delete with no dialog was exactly the problem fixed with #17350: it depends on autosave has saved the layer or not in the background.

comment:8 by Klumbumbus, 5 years ago

The remaining case is ticket:10832#comment:5

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user. Next status will be 'new'.
Next status will be 'needinfo'. The owner will be changed from team to naoliv.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.