Modify

Opened 3 weeks ago

Closed 10 days ago

#20313 closed defect (fixed)

Relation editor: Changes of "uninteresting" tags in mapview not recognized.

Reported by: skyper Owned by: GerdP
Priority: major Milestone: 21.01
Component: Core Version: latest
Keywords: template_report regression relation editor Cc:

Description

What steps will reproduce the problem?

  1. Have a relation selected and open a relation editor.
  2. Change a tag in Tags/Membership Panel
  3. Try to refresh relation in relation manager

What is the expected result?

The refresh button should be enabled.

What happens instead?

The refresh button is disabled and saving the relation from the relation editor overwrites the previously made changes.

Please provide any additional information below. Attach a screenshot if possible.

I also noticed that if I select another relation in mapview and change a tag value of both relations in Tags/Membership panel to the value of the relation with open relation editor, the refresh button is enabled though there were no changes of this relation.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-12-27 20:15:27 +0100 (Sun, 27 Dec 2020)
Revision:17426
Build-Date:2020-12-28 02:30:52
URL:https://josm.openstreetmap.de/svn/trunk

Attachments (1)

josm_20313_example.osm.xz (1.6 KB) - added by skyper 2 weeks ago.
example relation

Download all attachments as: .zip

Change History (22)

comment:1 Changed 3 weeks ago by GerdP

Owner: changed from team to skyper
Status: newneedinfo

I can't reproduce this with r17432. When I change or add a tag the refresh button is enabled. Please describe more details.

comment:2 Changed 2 weeks ago by skyper

I tried to reproduce without success until now. Do not really understand what is going on but, maybe, it depends on memory and long editing sessions.

I fear, that when I save/close the session this error will vanish again, what to do?

comment:3 Changed 2 weeks ago by GerdP

I don't understand. If you cannot reproduce it, what will vanish?

comment:4 Changed 2 weeks ago by skyper

Well, I happens atm, all the time, but I do not know what I have to do to get to this state.

What information is useful before I quite JOSM and start my saved session, in order to see, if I can still reproduce it then?

comment:5 Changed 2 weeks ago by Hb---

How many data layers do you use?

comment:6 in reply to:  4 Changed 2 weeks ago by GerdP

Replying to skyper:

Well, I happens atm, all the time, but I do not know what I have to do to get to this state.

What information is useful before I quite JOSM and start my saved session, in order to see, if I can still reproduce it then?

Hmm, maybe a field is not properly initialized.

  • How many relation editor windows are open?
  • Does it happen when you open the relation editor for a relation that was edited before or also for one that you didn't touch in this session?

comment:7 Changed 2 weeks ago by skyper

Does not matter if the relation is new or old and if modified or not. Adding a new tag enables the refresh button but deleting tag or changing the value does not trigger it.

I only work with one relation editor most of the time but within this session I might have had five or more open at once.

comment:8 Changed 2 weeks ago by GerdP

OK. My understanding is that it worked fine at the beginning of the session and now it no longer does? How exactly do you change or delete a tag? Mouse clicks or hot keys?

comment:9 Changed 2 weeks ago by skyper

For deleting I usually use the button of the panel. For changing and adding tags I usually use hotkeys or double click into the fields. Does not make any difference at the moment.

comment:10 Changed 2 weeks ago by skyper

Ok, one difference might be that I have uploaded within this session but behavior is the same for untouched, already uploaded or new and/or modified relations, now.

comment:11 Changed 2 weeks ago by GerdP

OK, some minutes ago I thought I had the same situation but it disappeared and I can't say for sure that I modified the relation which was in the relation editor. I guess it only happens with multiple editor windows open and maybe something else like a layer change or undo/redo. I'll look again at this tomorrow.

comment:12 in reply to:  5 Changed 2 weeks ago by skyper

Replying to Hb---:

How many data layers do you use?

Right, I work on one layer with sometimes several relation editors and I create new layers to download some data I merge to the working layer. I do not modify any data in these "download" layers and delete them after a short time but I might open a relation editor in these layers. I am pretty sure, I did not open the same relation editor in two different data layers at once.

Changed 2 weeks ago by skyper

Attachment: josm_20313_example.osm.xz added

example relation

comment:13 Changed 2 weeks ago by skyper

Found a relation which always triggers the bug, see josm_20313_example.osm.xz.

  1. Load file
  2. Select relation in relation list panel and select it with the select button of this panel
  3. Open relation editor with Edit button of relation list panel
  4. Delete FIXME=* or description=* tag by selecting the tag in the tags/membership panel and clicking on delete button.

Deleting other tags does not show the bug, so it depends on the key.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-01-03 23:41:13 +0100 (Sun, 03 Jan 2021)
Revision:17435
Build-Date:2021-01-04 02:30:49
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17435 en) Linux Debian GNU/Linux 10 (buster)
Memory Usage: 175 MB / 962 MB (84 MB allocated, but free)
Java version: 11.0.9.1+1-post-Debian-1deb10u2, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1366×768 (scaling 1.00×1.00)
Maximum Screen Size: 1366×768
Best cursor sizes: 16×16→16×16, 32×32→32×32
Desktop environment: GNOME
Java package: openjdk-11-jre:amd64-11.0.9.1+1-1~deb10u2
Environment variable LANG: en_US.utf8
libcommons-compress-java: libcommons-compress-java:all-1.18-2+deb10u1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20181227-1
liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-2
VM arguments: [-Djosm.home=<josm.pref>/]
Program arguments: [Downloads/josm_20313_example.osm.xz]
Dataset consistency test: No problems found

comment:14 Changed 2 weeks ago by skyper

Owner: changed from skyper to team
Status: needinfonew

comment:15 Changed 2 weeks ago by GerdP

Owner: changed from team to GerdP
Status: newassigned

See also #20289.
It happens with all tag keys that are returned by AbstractPrimitive.getUninterestingKeys().
We use a method OsmPrimitive.hasEqualSemanticAttributes(OsmPrimitive other) to compare two relations and the javadoc says

Replies true if this primitive and other are equal with respect to their semantic attributes. 
1.equal id
2.both are complete or both are incomplete
3.both have the same tags

BUT this method ignores a difference of the so called uninteresting keys, and both FIXME and description are considered uninteresting. These two tags were added for #5174

I do not yet understand why the method ignores the uninteresting keys. The same method is used in DataSetMerger and some other methods.

comment:16 Changed 2 weeks ago by GerdP

Summary: Relation editor: Changes of tags in mapview not recognized.Relation editor: Changes of "uninteresting" tags in mapview not recognized.

comment:17 Changed 2 weeks ago by GerdP

In 17444/josm:

see #20313: Relation editor: Changes of "uninteresting" tags in mapview not recognized.

  • don't ignore "uninteresting" tags when comparing relation in editor with that the original

comment:18 Changed 2 weeks ago by GerdP

This change should fix the problem only in relation editor. I think it would be better to change

  • src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

     
    926926     * @return true if this primitive and other are equal with respect to their semantic attributes.
    927927     */
    928928    public final boolean hasEqualSemanticAttributes(OsmPrimitive other) {
    929         return hasEqualSemanticAttributes(other, true);
     929        return hasEqualSemanticAttributes(other, false);
    930930    }
    931931
    932932    boolean hasEqualSemanticFlags(final OsmPrimitive other) {

so that the method matches the javadoc, but maybe I have to change the javadoc instead.

BTW: I still have no idea why some tags are considered uninteresting. The concept is very old, it was started with r367, but it seems to be about rendering.

comment:19 Changed 2 weeks ago by GerdP

As expected I see the same problem when I

  1. duplicate the layer with the relation
  2. change the FIXME to recheck stops2 in one layer
  3. change the FIXME to recheck stops3 in the other layer or delete the FIXME tag
  4. and finally use merge layers

There is no conflict. I think this also is an error?

comment:20 Changed 10 days ago by GerdP

In 17456/josm:

see #20313: Relation editor: Changes of "uninteresting" tags in mapview not recognized.
and #12599: Added/deleted "uninteresting" tags are "reverted" by downloading area again (twice)

  • let method hasEqualSemanticAttributes compare all tags by default (as the javadoc states)

comment:21 Changed 10 days ago by GerdP

Milestone: 21.01
Resolution: fixed
Status: assignedclosed

Presuming that no unit test fails this should be fixed now.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.