Maniphest search for custom users field can return incorrect results


Observed Behavior
When searching for tasks with a custom users field, it can happen, you see tasks the user was once attached too but isn’t anymore.

Expected Behavior:
When searching for tasks with a custom users field, I want to see only those tasks a user is really attached too.

Phabricator Version:
phabricator 26d0862f4f6fff3a38e6f7d6f070c1c16f203db7 (Thu, May 10)
arcanist d581c453b83c515f3acac963bbc117e8dd0d1ef4 (Mon, May 14)
phutil 20eff1c8d14f08f05ef72828fa379e871d29662c (Apr 13 2018)

Reproduction Steps:
(1) You have a simple custom field definition in maniphest of the type “users”.
(2) You have activated the search feature.
Example defintion:

"maniphest.custom-field-definitions": {
  "bad-search:user": {
    "name": "Test User",
    "type": "users",
    "search": true

(3) You add user1 to this field in task1.
(4) You search for user1 with this field and the result is correct: the result is task1.
(5) You remove user1 from this this field by editing task1.
(6) You search again for user1 and the result is wrong: you still see task1, even if the user is not attached to the custom field.


Small bump. When it is reproducible, it is not a small bug :wink:


I don’t like to bump, but I really would like this bug to get reproduced and then fixed.


I’m facing something like this: I have a custom field of maniphest form, which type is “users” and I enable search by this custom field. When I use maniphest advanced search, I got no result even I’m sure I have some tasks are related to the user.