Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3521 closed defect (wontfix)

Prevent uploads of duplicate objects

Reported by: stanton Owned by: Tom Hughes
Priority: minor Milestone:
Component: api Version:
Keywords: Cc: koltie@…

Description

For some reason I just happened to upload a bunch of newly-created objects twice. I don't exactly know how it happened, in any case I spent a decent amount of time finding the dupes and deleting them.

In my case the editor happened to be JOSM, but I have heard about similar issues having happened with Potlatch or mass imports (Tiger).

In my opinion, the API should detect attempts to upload an object which is identical to an existing one and handle these gracefully:

  • Either reject the object (naive approach)
  • Or silently discard the duplicate object and return the ID of the already-existing object to the client (elegant approach).

I'd favor the latter: the only compatibility issue with existing editors might be if the existing object has a version higher that 1, hence the newly-created object would set off with a version number higher than 1 - this might upset some editors and would need to be handled (e.g. by returning version 1; clients would then have to sync to do further editing).

Objects are assumed to be identical if:

  • they have exactly the same set of tags and values and
  • points have identical coordinates
  • ways consist of the same points, in the same order
  • relations have the same members, with the same roles and in the same order

I'd avoid fuzzy matching (rejecting an object because a similar one already exists) - this further increases complexity and may lead to false positives, with potentially undesirable side effects.

In any case, I think preventing insertion of dupes would ease some problems with faulty editors or user errors. Cleaning up manually afterwards is a mess.

Change History (2)

comment:1 Changed 8 years ago by Tom Hughes

Resolution: wontfix
Status: newclosed

So, in order to avoid problems caused by the exceedingly rare event of somebody uploading changes twice you want to impose a massive cost on all uploads of doing duplicate detection...

Sorry, not going to happen.

comment:2 Changed 8 years ago by Kozuch

Cc: koltie@… added

Checking for dupes would be very useful. I work with relations a lot and I would appreciate similar function in order to prevent from mistakes. Sure some relations (routes) can contain intentional dupes, but many can not.

Note: See TracTickets for help on using tickets.