https://bugzilla.wikimedia.org/show_bug.cgi?id=64306
Bug ID: 64306 Summary: IdGenerator should skip "used" IDs. Product: MediaWiki extensions Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: WikidataRepo Assignee: wikidata-b...@lists.wikimedia.org Reporter: daniel.kinz...@wikimedia.de CC: wikidata-b...@lists.wikimedia.org Web browser: --- Mobile Platform: --- When generating the next ID for some kind of entity, IdGenerator should check whether that supposedly new ID was already used after all, and discard it if so. This process should be repeated a limited number of times, and an exception raised of no unused ID could be found with some fixed number of tried. An ID is considered "used" if an EntityTitleLookup returns a Title object for that ID, and a call to exists() on that title returns true. The rationale is that entities with IDs beyond the current counter may be created on a wiki via importing. Checking whether the "next" ID was already used prevents nasty conflicts and errors when such imported entities exist on a wiki. The cost should be relatively low, since new IDs are not often needed, checking is relatively cheap, and conflicts very rare. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l