Page MenuHomePhabricator

Some Phlogiston tasks have the wrong status
Closed, ResolvedPublic

Description

The first two items on http://phlogiston-dev.wmflabs.org/ve_recently_closed.html aren't closed, and never have been, for instance.

Examples:
190765
190686

Both show status resolved for all entries in task_on_date, even though they have no status-altering transactions and their initial load status is open.

Event Timeline

After multiple rebuilds and the fixing of unrelated bugs, 190765 now shows as open, but 190686 is still falsely shown as resolved.

At least two different problems here:

  1. 190686 has no transactions loaded in phlogiston, although there are transactions in the dump
  2. All of 190686's task_on_date entries have status = resolved, even though there are no transactions and the status on load is 'open'
  1. is because there are no transactions of interest to Phlogiston (edge changes, status changes)
  2. has been narrowed down to the SQL function fix_status(), and appears to be because of sloppy syntax on a SQL query.
UPDATE task_on_date tod
   SET status = mta.status_at_load
  FROM maniphest_task mta
 WHERE tod.id = mta.id
   AND status IS NULL OR status = ''
   AND scope = scope_prefix;

should be:

UPDATE task_on_date tod
   SET status = mta.status_at_load
  FROM maniphest_task mta
 WHERE tod.id = mta.id
   AND (status IS NULL OR status = '')
   AND scope = scope_prefix;

This fixed a test case; now running the whole thing.