Ignore:
Timestamp:
2020-05-13T15:24:14+02:00 (4 years ago)
Author:
GerdP
Message:

fix #18915: "Precondition violation" not fixable from within JOSM

  • correct handling of precondition failure responses that contain the word requires so that the correct objects are downloaded. The parents are needed, not the childern.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java

    r15586 r16407  
    88import java.net.HttpURLConnection;
    99import java.text.DateFormat;
     10import java.util.ArrayList;
    1011import java.util.Arrays;
    1112import java.util.Collection;
     
    264265        );
    265266        if (ret == 0) {
    266             DownloadReferrersAction.downloadReferrers(MainApplication.getLayerManager().getEditLayer(), Arrays.asList(conflict.a));
     267            if (msg.contains("to delete")) {
     268                DownloadReferrersAction.downloadReferrers(MainApplication.getLayerManager().getEditLayer(),
     269                        Arrays.asList(conflict.a));
     270            }
     271            if (msg.contains("to upload") && !conflict.b.isEmpty()) {
     272                MainApplication.worker.submit(new DownloadPrimitivesTask(
     273                        MainApplication.getLayerManager().getEditLayer(), new ArrayList<>(conflict.b), false));
     274            }
    267275        }
    268276    }
Note: See TracChangeset for help on using the changeset viewer.