Modify

Opened 11 days ago

Closed 3 days ago

Last modified 3 days ago

#24747 closed defect (fixed)

[Patch] If loading terse .osm file with modifications, JOSM does not show changes in history but uploads them to OSM

Reported by: mnalis Owned by: GerdP
Priority: normal Milestone: 26.05
Component: Core Version:
Keywords: template_report history Cc:

Description (last modified by mnalis)

What steps will reproduce the problem?

  1. load an .osm file having changes in format like this: <way id='1161677679' action='modify' visible='true' version='1'> instead of like this: <way id='1161677679' action='modify' timestamp='2023-04-12T12:25:27Z' uid='52552' user='Matija Nalis' visible='true' version='1' changeset='134814862'>
  2. select such way in JOSM, and press ctrl-h for history
  3. click upload

What is the expected result?

  • in step (2), tags that were changed/added/deleted tags would be shown (as it normally happens with any changes!)

(additionally, even manually adding extra changes in JOSM to such elements afterwards will not show any changes in ctrl-h)

What happens instead?

  • in step (2), JOSM shows like there are no changes in element whatsoever (i.e. that it is unmodified)
  • however, in step(3), JOSM uploads those changes to OSM

Due to that inconsistency, user ends up confused (or even worse, oblivious) and likely ends up uploading data they though they verified, but they in fact didn't (as JOSM didn't tell them anything was modified, when in fact it was).

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

I'm aware that those .osm files are externally produced and thus the "blame" should be on them. However, I think JOSM should handle loading such files better:

  • either (preferably) accepting .osm files which missing user/uid and/or changeset attributes, and having history work correctly on them (i.e. if they are not strictly needed, which seems to be the case -- as I seem to be able to fake them with uid=1 changeset=1 and history works then),
  • or throwing error when attempting to load such .osm files (if missing attributes are required for proper functioning of JOSM)

I'll try to work with this specific tool to fix the issue at their side (i.e. produce "full" list of attributes), but there might be others tools which exhibit the problem without people noticing, thus JOSM fix would be nice.

attached pictures: how ctrl-h History looks with "full" action=modify line (i.e. correctly shows modifications), vs. how it looks with short one (i.e. falsely shows there are no modifications)

The problem was noticed by using this tool which e.g. on https://dina.osm-hr.org/ar/opstine/jasenovac/Trebe%C5%BE.html (when clicking on the button on the bottom and then the link, links to this remote control URL

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2026-03-28 20:28:41 +0100 (Sat, 28 Mar 2026)
Revision:19555
Build-Date:2026-03-29 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19555 en) Linux Debian GNU/Linux 13 (trixie)
Memory Usage: 1941 MB / 2987 MB (182 MB allocated, but free)
Java version: 21.0.11+10-1-deb13u2-Debian, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920x1080x[Multi depth]@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_US.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: ICEWM
Java package: openjdk-21-jre:amd64-21.0.11+10-1~deb13u2
libcommons-logging-java: libcommons-logging-java:all-1.3.0-2
fonts-noto: fonts-noto:all-20201225-2
VM arguments: [-Dsun.java2d.opengl=true, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]
Dataset consistency test: No problems found

Plugins:
+ DirectUpload (36474)
+ FixAddresses (36474)
+ ImageWayPoint (36474)
+ Mapillary (1819)
+ PicLayer (273)
+ Review.Changes (1.1.1)
+ apache-commons (36474)
+ apache-http (36474)
+ buildings_tools (36474)
+ conflation (279)
+ ejml (36474)
+ geotools (36474)
+ imagery_offset_db (36474)
+ jackson (36474)
+ jaxb (36474)
+ jna (36474)
+ jts (36474)
+ libphonenumber (9.0.31)
+ log4j (36474)
+ mbtiles (v2.8.1)
+ opendata (36474)
+ openqa (116)
+ osmwiki-dataitem (0.0.8)
+ panoramax (8)
+ phonenumber (1.2.0)
+ pmtiles (36474)
+ pt_assistant (682)
+ reverter (36474)
+ todo (159)
+ turnrestrictions (36474)
+ undelete (36474)
+ urbaneye3d (2.2.2)
+ utilsplugin2 (36497)
+ wikipedia (448)

Tagging presets:
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Healthcare&zip=1
+ https://<user.name>.com/prezentacije/OpenStreetMap/josm-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Xmas&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/GuidepostDirectionsAndDestinations&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ http://bezdomni.net/Styles_HighlightedCapesBays-style.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/ColorWays&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/CyclewaysStylingBNA&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/SidewalksPlus&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/BuildingColors&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1
+ ${HOME}/tmp/g/1/openaddresses-HR.mapcss

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/QAToolInspiredValidations&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingWeekdays&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/SourceObjectTag&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/IndoorRules&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/Pictures&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingOpeningHours&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/CheckDate&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/FacebookWebsite&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/DuplicateAttributes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingMain&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/OldCovid&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/NotCheck&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/ThisOrThat&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/ChargeRules&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/InvalidWebsiteProtocol&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/AddrFullWarning&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/AddrRelationWarning&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/CountryCodeCheck&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/Geology&zip=1
+ https://raw.githubusercontent.com/stefan-a-bauer/josm-validators/master/mtb.validator.mapcss
+ https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip
+ https://github.com/open-energy-transition/validate-my-grid/raw/refs/heads/gh-pages/power.validator.zip
+ https://josm.openstreetmap.de/josmfile?page=Rules/PublicTransportGtfs&zip=1
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/Seamark.validator.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/UnresolvedFIXMEs&zip=1

Last errors/warnings:
- 05346.026 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.165 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.307 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.446 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.584 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.726 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05346.864 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05347.002 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05347.142 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png
- 05347.281 E: Could not get message for https://osmose.openstreetmap.fr/images/markers/marker-b-%s.png

Attachments (3)

josm-manual-change.png (630.6 KB ) - added by mnalis 11 days ago.
full list of change attributes in .osm file shows changes correctly in ctrl-h
josm-auto-change1.png (731.6 KB ) - added by mnalis 11 days ago.
shortened list of change attributes in .osm file incorrectly does not show any changes in ctrl-h (but still uploads those changes)
24747.patch (1.1 KB ) - added by GerdP 6 days ago.
remove overcausious test

Download all attachments as: .zip

Change History (10)

by mnalis, 11 days ago

Attachment: josm-manual-change.png added

full list of change attributes in .osm file shows changes correctly in ctrl-h

by mnalis, 11 days ago

Attachment: josm-auto-change1.png added

shortened list of change attributes in .osm file incorrectly does not show any changes in ctrl-h (but still uploads those changes)

comment:1 by mnalis, 10 days ago

Description: modified (diff)

(ref. https://github.com/osm-hr/adresniregistar/issues/10 for that specific upstream issue)

comment:2 by GerdP, 6 days ago

Owner: changed from team to GerdP
Status: newassigned

I can reproduce this. The History dialog doesn't work when the tag changeset tag is missing.

comment:3 by GerdP, 6 days ago

This is related to the changes introduced for #6592. For some reason, the code in HistoryBrowserModel.canShowAsLatest() checks if an instance of HistoryOsmPrimitive can be created for the object. Since that fails it returns false. When I disable this check everything seems to work fine. Disabling the check would produce quite a lot of probably unused code, so I wonder why it was coded in the first place. Have to do some digging here.

by GerdP, 6 days ago

Attachment: 24747.patch added

remove overcausious test

comment:4 by GerdP, 6 days ago

Summary: If loading terse .osm file with modifications, JOSM does not show changes in history but uploads them to OSM[Patch] If loading terse .osm file with modifications, JOSM does not show changes in history but uploads them to OSM

comment:5 by GerdP, 3 days ago

Resolution: fixed
Status: assignedclosed

In 19578/josm:

fix #24747: If loading terse .osm file with modifications, JOSM does not show changes in history but uploads them to OSM

  • remove overcausious test

comment:6 by GerdP, 3 days ago

Milestone: 26.05

I worked one day with the patched version and found no problems. The change means that the public method HistoryOsmPrimitive.forOsmPrimitive() is no longer used in core, but I think we can keep that simple code.

comment:7 by gaben, 3 days ago

Keywords: history added

There have been ongoing issues with the history panel for a long time. This is unrelated to the ticket, but I can still create use cases where the history does not show modifications. I'll try to clean it up once I have time.

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. Next status will be 'reopened'.

Add Comment


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