Page MenuHomePhabricator

Claim guid case difference in ChangeOpClaim means duplicate claims are created when editing
Closed, ResolvedPublic


When you change the order of snaks, the edit summary is wrong.

Version: REL1_21-branch
Severity: blocker



Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 2:20 AM
bzimport set Reference to bz55514.
bzimport added a subscriber: Unknown Object (MLST).

It shows "Created claim" but it should be "Changed claim"

The problem is not the summary, the summary is actually correct for the eventual action. This is instead na issue with lower vs upper case entity ids prepending the guid of claims.

ChangeOpClaim parses guids using the claim guid parser.
When parsing a claim GUID such as


a claim guid object is created.

This object consists of an EntityId object and a claim guid string.
When we call getSerilization() for this object we get the serilized entityId and the claim guid string. Due to the change to uppercase for EntityIds this means we get.


Therefore when calling $claims->hasClaimWithGuid( $guid->getSerialization() ) we get false when expecting true.
Therefore the claim is not removed before the updated claim is added and thus we have duplicate claims with identical GUIDS...

Patch has been merged in master (and I wonder why the Gerrit bot did not update this ticket).

Addshore: Any reason you set the Version field from "master" to "REL1_21 branch"?

Change 88949 had a related patch set uploaded by Tobias Gritschacher:
Fix claim weirdness

Needed on master and on REL1_21 as we branched before this was noticed and patched.

(Not sure if that should have been added as a separate bug or not.)

Both patches are now merged.

Change 88949 merged by jenkins-bot:
Fix claim weirdness (cherry picked from commit 46948189c275acd63429f6e42e26d3bc551e9ee4)