Last modified: 2013-07-03 13:48:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46101, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44101 - Edit conflict detection for claims still having some issues
Edit conflict detection for claims still having some issues
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-18 11:20 UTC by tobias.gritschacher
Modified: 2013-07-03 13:48 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description tobias.gritschacher 2013-01-18 11:20:46 UTC
There are issues when edit conflicts are occurring for claims:

1) User A edits a claim, User B edits the same claim without refreshing the page before, an error is shown saying "Exception Caught: Can only add \Wikibase\Claim implementing objects to Wikibase\Claims." but it should report an edit conflict instead.

2) User A edits a claim, User B edits the same claim but clicks on save without actually changing the claim. In that case the claim will be overwritten by User B without notice but an edit conflict should be detected instead.
Comment 1 Jeroen De Dauw 2013-01-30 14:26:44 UTC
When bailing on assert violations, you'll see the issue occurs before that point:

Warning: assert(): Assertion failed in /home/j/www/phase3/extensions/Wikibase/lib/includes/claim/Claims.php on line 223

This means

$claims->getByElementHash( $diffOp->getNewValue() );

is returning false (I have verified this) while the list should contain the claim. This makes me suspect there is a bug in HashArray, the class on which Claims is build. Not been able to track it down further so far.
Comment 2 Jeroen De Dauw 2013-01-30 14:37:49 UTC
Doing a dump of state causing the error:

added under $claim = $claims->getByElementHash( $diffOp->getNewValue() );

if(!($claim instanceof Claim)) {
q($this, $claims, $sourceHashes, $targetHashes, $claim);
}

<pre class='xdebug-var-dump' dir='ltr'>
<b>object</b>(<i>Wikibase\Claims</i>)[<i>108</i>]
  
    <b>object</b>(<i>Wikibase\Statement</i>)[<i>66</i>]
      <i>protected</i> 'references' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\ReferenceList</i>)[<i>109</i>]
      <i>protected</i> 'rank' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>1</font>
      <i>protected</i> 'mainSnak' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\PropertyValueSnak</i>)[<i>67</i>]
          <i>protected</i> 'dataValue' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>Wikibase\EntityId</i>)[<i>68</i>]
              <i>protected</i> 'entityType' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'item'</font> <i>(length=4)</i>
              <i>protected</i> 'numericId' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>28</font>
          <i>protected</i> 'propertyId' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>Wikibase\EntityId</i>)[<i>69</i>]
              <i>protected</i> 'entityType' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'property'</font> <i>(length=8)</i>
              <i>protected</i> 'numericId' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>14</font>
      <i>protected</i> 'qualifiers' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\SnakList</i>)[<i>65</i>]
      <i>protected</i> 'guid' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'q35$9191D62B-EC8A-45AD-8068-BEE0B60308E6'</font> <i>(length=40)</i>
</pre>
<pre class='xdebug-var-dump' dir='ltr'>
<b>object</b>(<i>Wikibase\Claims</i>)[<i>110</i>]
  
    <b>object</b>(<i>Wikibase\Statement</i>)[<i>101</i>]
      <i>protected</i> 'references' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\ReferenceList</i>)[<i>96</i>]
      <i>protected</i> 'rank' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>1</font>
      <i>protected</i> 'mainSnak' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\PropertyValueSnak</i>)[<i>88</i>]
          <i>protected</i> 'dataValue' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>Wikibase\EntityId</i>)[<i>95</i>]
              <i>protected</i> 'entityType' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'item'</font> <i>(length=4)</i>
              <i>protected</i> 'numericId' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>22</font>
          <i>protected</i> 'propertyId' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>Wikibase\EntityId</i>)[<i>104</i>]
              <i>protected</i> 'entityType' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'property'</font> <i>(length=8)</i>
              <i>protected</i> 'numericId' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>14</font>
      <i>protected</i> 'qualifiers' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Wikibase\SnakList</i>)[<i>94</i>]
      <i>protected</i> 'guid' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'q35$9191D62B-EC8A-45AD-8068-BEE0B60308E6'</font> <i>(length=40)</i>
</pre>
<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=1)</i>
  0 <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'7efc8e1c8696d2a639dee79bb6d76ab190898aa3'</font> <i>(length=40)</i>
</pre>
<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=1)</i>
  0 <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'3cefed471aa6a8cb29eed34f006181d257d9ef6d'</font> <i>(length=40)</i>
</pre>
<pre class='xdebug-var-dump' dir='ltr'><small>boolean</small> <font color='#75507b'>false</font>
</pre>
Comment 3 Jeroen De Dauw 2013-01-30 19:50:02 UTC
https://gerrit.wikimedia.org/r/#/c/46814/
Comment 4 tobias.gritschacher 2013-01-31 10:07:15 UTC
(In reply to comment #3)
> https://gerrit.wikimedia.org/r/#/c/46814/

Update Issue 1:
After that change got merged the error message changed from "Exception Caught: Can only add \Wikibase\Claim implementing objects to Wikibase\Claims." to "Failed to save the change" but it should be "Edit not allowed: Edit conflict." in that case.

Update Issue 2:
This issue is still there.
Comment 5 tobias.gritschacher 2013-04-29 08:34:35 UTC
related patchsets:
https://gerrit.wikimedia.org/r/#/c/60870/
https://gerrit.wikimedia.org/r/#/c/60872/
Comment 6 tobias.gritschacher 2013-04-29 08:36:17 UTC
Issue I is solved.
Comment 7 denny vrandecic 2013-07-03 13:48:31 UTC
Issue II should be solved by merit of unchanged values not being possible to save.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links