2

Some posts (questions or answers) have a last_edit_date but no last_editor. Does this always mean that the post was last edited by the post owner?

Example: stackapps.com/a/3891/



PS: This issue came up on pull-request 101 of the stack-mode project.

4
  • 1
    Pretty sure the last editor can be a deleted user who is not the OP. So the last_editor property would be blank/missing. You'd have to run /posts/{ids}/revisions to be certain. Nov 26, 2014 at 14:16
  • @BrockAdams That makes sense. Do you know of a way I can find a live example? Possibly the Data Explorer? Nov 26, 2014 at 14:31
  • I've got a query going -- who knew I remembered so much SQL? (that is at least slightly tongue-in-cheek; even I know that this isn't a complex query.) data.stackexchange.com/stackoverflow/query/251122 Nov 26, 2014 at 14:40

1 Answer 1

2

last_editor will be missing (empty) from the results when the last editor is a deleted user. This deleted user does not have to be the owner, or original poster, of a given question or answer.

For example, see this answer -- which looks like this in the API:

{
  "owner": {
    "user_id": 362168,
    "user_type": "registered",
    "display_name": "Saqueib"
  },
  "is_accepted": true,
  "score": 1,
  "last_activity_date": 1416395361,
  /*-- last_editor is enabled in the filter, but not returned because 
    the user was deleted.
  */
  "last_edit_date": 1416395361,
  "creation_date": 1416390599,
  "answer_id": 27013671,
  "question_id": 27013595
}

The owner is user 362168, while the last editor is a deleted user.

For more examples, see this edit of Sean Allred's SEDE query.


In the case of multiple deleted users, or to determine more information, use the /posts/{ids}/revisions route. Which in this case gives:

{
  "user": {
    "user_type": "does_not_exist",
    "display_name": "user4269260"
  },
  ...
  "post_id": 27013671,
  "revision_type": "single_user",
  "revision_number": 5,
  "comment": "syntax edits",
  "revision_guid": "6C1F8C97-615C-4834-B9C5-881CB3F166E5"
},
{
  "user": {
    "user_id": 362168,
    "user_type": "registered",
    "display_name": "Saqueib"
  },
  ...
  "post_id": 27013671,
  "revision_type": "single_user",
  "revision_number": 4,
  "comment": "added 33 characters in body",
  "revision_guid": "C55616E3-4467-4240-8781-8ED91D006C1D"
},

Note that for revision_number 5, user_id is not present because deleted user's ids are removed (or hidden from us plebes).

It is for this same reason that last_editor is missing, because that is of type user_id.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .