Lucas_Werkmeister_WMDE added a comment.

  I think there’s some weird interaction between `$.when` and jQuery deferreds 
going on in `gadget.js`’s `_fullCheckAllIds` / 
`_aggregateMultipleWbcheckconstraintsResponses`. When there’s only one API 
request (≤50 entities on the page), the `arguments` to the aggregate function 
look like:
  
    {
    "0": { "wbcheckconstraints": {...}, "success": 1 } },
    "1": { "readyState": 4, "getResponseHeader": ... },
    }
  
  where the first argument is apparently an API response (JSON-decoded) and the 
second argument is some kind of additional response data, which happens to get 
ignored due to how the method is implemented. But when there’s more than one 
API request, it instead looks like:
  
    {
    "0": [ { "wbcheckconstraints": {...}, "success": 1 } }, { "readyState": 4, 
"getResponseHeader": ... } ],
    "1": [ { "wbcheckconstraints": {...}, "success": 1 } }, { "readyState": 4, 
"getResponseHeader": ... } ],
    }
  
  where we suddenly have an array of these responseData/responseMeta pairs. But 
the method expects each argument to be one response data, so in this case it 
doesn’t find any constraint violations (neither argument has a 
`wbcheckconstraints` member).
  
  Also, it’s kind of evil that `_fullCheckAllIds()` makes all the constraint 
check requests in parallel in the first place. I think we should rewrite this 
to do the requests sequentially (chain the promises after one another) and then 
check that this also resolves the buggy merging.

TASK DETAIL
  https://phabricator.wikimedia.org/T345177

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, mrephabricator, Nikki, Danny_Benjafield_WMDE, 
Astuthiodit_1, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, 
Eihel, Nandana, Lahi, Gq86, GoranSMilovanovic, Mahir256, QZanden, Esc3300, 
LawExplorer, _jensen, rosalieper, Agabi10, Scott_WUaS, abian, Wikidata-bugs, 
aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to