Page MenuHomePhabricator

Deleting an endorsement returns an error: jade-bad-content
Closed, ResolvedPublic

Description

  1. Go to https://deployment.wikimedia.beta.wmflabs.org/wiki/Jade:Diff/4
  2. Expand "alternatives".
  3. Try to delete the endorsement by "Halfak"
  4. Click "delete endorsement" in the confirmation dialog
  5. Get an error.

This is what I see in the console.

{"error":
  {"code":"jade-bad-content",
   "info":"Jade Entity doesn't conform to schema: Error validating /facets/editquality/proposals/0/endorsements: Object value found, but an array is required",
   "*":"See https://deployment.wikimedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},
 "servedby":"deployment-mediawiki-07"}

Event Timeline

Halfak created this task.Mar 18 2020, 1:36 PM
Halfak triaged this task as High priority.Mar 24 2020, 5:09 PM
Halfak moved this task from Untriaged to Ready to go on the Scoring-platform-team board.

I wonder if this is also a problem for moving another person's endorsement. That should be prevented and an error should make it clear why it is not possible to move someone else's endorsement.

kevinbazira added a subscriber: kevinbazira.

I have pushed a patchset for this issue. Turns out User A was able to delete an endorsement created by User A but was not able to delete an endorsement created by User B. Now User A is able to delete an endorsement created by User B.

Aha! The move endorsement relies on matching your logged-in (or not) user status with an endorsement in order to move it. So the only way to move someone else's endorsement is to long in as them. So that's perfect and we don't need to worry about that.

Change 589026 had a related patch set uploaded (by Kevin Bazira; owner: Kevin Bazira):
[mediawiki/extensions/Jade@master] Fix endorsement delete bug

https://gerrit.wikimedia.org/r/589026

Change 589026 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Fix endorsement delete bug

https://gerrit.wikimedia.org/r/589026

Patchset looks good @kevinbazira, +2'd and merged

Halfak closed this task as Resolved.Mon, Jun 22, 4:36 PM