﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
24021	Task Data is Imported into Multiple Data Layers (or Existing Ones) when Multitask Validating via the HOT Tasking Manager: II (cloned)	Gregory Peony	team	"Cloned from #23821:
 ==== What steps will reproduce the problem?
1. Log in to HOT TM, or the Staging Site.
2. Find a project (on which you are permitted to validate) with multiple tasks marked as mapped.
3. Run JOSM and allow it to load. 
4. Ensure that manual confirmation of remote control actions is enabled, via JOSM remote preferences. I also happen to have the download as new layer option selected.
 a. To see the error variation where data is loaded into existing layers you can “open location” (ctrl + l) and input the following, (change the project ID as appropriate, then download: `https://tasking-manager-tm4-production-api.hotosm.org/api/v2/projects/13763/tasks/?as_file=true&format=geojson`
5. Select multiple tasks to validate, and begin validation; pop-ups should now begin appearing in JOSM asking for your confirmation to import data. (In my experiments I chose to validate 4 tasks simultaneously, and I think that this is a good number to test, but it also occurs with over 100 tasks selected). 
6. One by one, accept the requests by clicking the “yes once” button on all of the pop-ups. If the yes always button is used on task data requests, then it will alter the behaviour, and JOSM will have to be reloaded to load task data individually.
7. You may now see that the task data is loaded into multiple OSM Data layers, if no data layers were previously loaded. If at least one data layer was previously loaded then some of the OSM data may be loaded into existing layers. N.B. Although I was able to repeatedly trigger the error very consistently, the error is not guaranteed to occur, and therefore you may need to (optionally delete the existing layers loaded in JOSM, and) reload the editor via the Tasking Manager several times. 
 
 ==== What is the expected result?
The OSM data within the boundaries of all selected tasks should either be loaded into new layers where the data of each task is contained in a seperate layer, or the data within the task boundaries should be loaded into a single layer (preferably a new one given that layers can be mereged but not seperated).
 
 ==== What happens instead?
 2 things can happen:
 - Some of the OSM data is loaded into a new layer and the rest is loaded into an existing layer e.g. a task grid layer or existing OSM data layer.
 - OSM data is loaded into 2 new seperate layers.
 
 ==== Please provide any additional information below. Attach a screenshot if possible.

Although the order in which import requests are served are consistent on a macro level, the order in which import requests for specific tasks is not. i.e. imports are always requested in the following order boundary->imagery->OSM data, but the order of the OSM data is not always the same.

The task with the lowest ID appears to be significant becasue the 'split' usually occurs when it is loaded in a 'middle' position (or at the very least not first) e.g. when loaded 2nd or 3rd in a group of 4 tasks. I have attached some annotated images to illustrate this. NL = New Layer, + = the task which 'created' the new layer.

I don't know how to add a screen shot to the description that isn't already uploaded elsewhere when creating a ticket *~* is it even possible?
> - Task boundaries are loaded okay 
> - Issue seems to happen at random, is not always reproducable
> - Issue not restricted to specific project or browser
> - No issue when using iD Editor
> - See for more details this Slack discussion: https://hotosm.slack.com/archives/C319P09PB/p1718997016201369
> - In attachment of this ticket you find results of jq output of HAR file. Also included are screenshots of JOSM
> 
> {{{
> Relative:URL: ^/trunk
> Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
> Last:Changed Date: 2024-07-02 17:10:50 +0200 (Tue, 02 Jul 2024)
> Revision:19128
> Build-Date:2024-07-03 01:31:15
> URL:https://josm.openstreetmap.de/svn/trunk
> 
Identification: JOSM/1.5 (19253 en) Windows 10 64-Bit
> OS Build number: Windows 10 Pro 22H2 (19045)
> Memory Usage: 540 MB / 4070 MB (294 MB allocated, but free)
> Java version: 17.0.11+9, Eclipse Adoptium, OpenJDK 64-Bit Server VM
> Look and Feel: com.formdev.flatlaf.FlatDarculaLaf
> Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.25×1.25) \Display1 1920x1200x32bpp@59Hz (scaling 1.25×1.25) \Display2 1920x1080x32bpp@59Hz (scaling 1.25×1.25)
> Maximum Screen Size: 1920×1200
> Best cursor sizes: 16×16→32×32, 32×32→32×32
> System property file.encoding: Cp1252
> System property sun.jnu.encoding: Cp1252
> Locale info: en_US
> Numbers with default locale: 1234567890 -> 1234567890
> VM arguments: [-Duser.home=%UserProfile%]
> 
> Plugins:
> + Create_grid_of_ways (36178)
> + FastDraw (36226)
> + Mapillary (2.2.4)
> + SimplifyArea (36209)
> + apache-commons (36273)
> + apache-http (36273)
> + buildings_tools (36226)
> + changeset-viewer (0.0.7)
> + continuosDownload (103)
> + flatlaf (36176)
> + gridify (1718663815)
> + jackson (36273)
> + jna (36273)
> + log4j (36273)
> + mapathoner (1.5.5)
> + markseen (14)
> + measurement (36256)
> + reltoolbox (36280)
> + reverter (36256)
> + scripting (v0.3.1)
> + terracer (36205)
> + todo (137)
> + turnrestrictions (36226)
> + undelete (36226)
> + utilsplugin2 (36241)
> 
> Tagging presets:
> + C:\Users\Public\Documents\portableappsPlatform\scripts\josm.building.xml
> 
> Map paint styles:
> + https://gitlab.com/peculiar-theater/mapcss/-/raw/main/tm-taskgrid/tm-taskgrid.mapcss
> + https://gitlab.com/peculiar-theater/mapcss/-/archive/main/mapcss-main.zip?path=tm-taskgrid
> + https://github.com/MissingMaps/josm_styles/archive/master.zip
> + https://github.com/osmlab/applepaintstyles/archive/main.zip
> + https://josm.openstreetmap.de/josmfile?page=Styles/ColorWays&style
> + https://josm.openstreetmap.de/josmfile?page=Styles/NewModifiedBuildings&zip=1
> + https://josm.openstreetmap.de/josmfile?page=Styles/ModifiedHighways&zip=1
> - C:\Users\<user.name>\Desktop\HOT OSM\mapcss\modified-highways\modified-highways.mapcss
> - C:\Users\<user.name>\Desktop\HOT OSM\mapcss\new-modified-buildings\test\test-new-modified.mapcss
> - https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
> - https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
> - C:\Users\<user.name>\Desktop\HOT OSM\mapcss\user.mapcss
> - https://github.com/MissingMaps/josm_styles/archive/master.zip
> - https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
> - https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
> - https://raw.githubusercontent.com/MarkCupitt/HOT-Osm-Validation/44b408bcfb9818e7f6a69eea7022d26299a7ba7a/HOT-Validate.mapcss
> - https://github.com/hotosm/HDM-JOSM-style/archive/master.zip
> 
> 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/ValidatingBuildingsInHOTTMProjects&zip=1
> 
> Last errors/warnings:
> - 00000.617 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
> - 00000.622 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
> - 00004.564 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl
> - 00004.881 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl
> }}}
"	defect	new	normal		Core remotecontrol	tested		Multitask Validation Import Remote Layer	
