Page MenuHomePhabricator

In conduit, make auto resolve task via review land look the same as manual resolve
Open, NormalPublic

Description

They are slightly different, and this caused a bug in tenXer because we were expecting the string version of newValue. (I'm fixing that expectation in tenXer, but still better to be consistent because others might have the same issue.)

Example excerpts from https://tools.tenxer-corp.com/conduit/method/maniphest.gettasktransactions/

auto resolve

{
  "taskID"          : "5493",
  "transactionType" : "status",
  "oldValue"        : "0",
  "newValue"        : 1,
  "comments"        : null,
  "authorPHID"      : "PHID-USER-2d7perc36s5g6pd4dq7i",
  "dateCreated"     : "1365780938"
},

manual resolve

{
  "taskID"          : "5493",
  "transactionType" : "status",
  "oldValue"        : "0",
  "newValue"        : "1",
  "comments"        : "",
  "authorPHID"      : "PHID-USER-2d7perc36s5g6pd4dq7i",
  "dateCreated"     : "1365783330"
}

Related Objects

StatusAssignedTask
DuplicateNone
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedchad
Resolvedchad
OpenNone
OpenNone
DuplicateNone
Resolvedchad
ResolvedNone
Resolvedhsb
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedjoshuaspence
Resolvedepriestley
Resolvedbtrahan
Resolvedbtrahan
Duplicateepriestley
Resolvedepriestley
Wontfixepriestley
Resolvedepriestley
Resolvedepriestley
DuplicateNone
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
OpenNone

Event Timeline

epriestley triaged this task as Normal priority.Apr 12 2013, 7:58 PM

I think there are two levels of systematic fix here:

  1. {T2217} should make transactions look consistent, at least (we can do a retroactive fix when we migrate, too).
  2. Ideally, we would be representing values properly in JSON (e.g., false would be better than either 0 or "0" as a parameter value) but this is a bit trickier because we can't store true and false in MySQL.

On (2), I intend to add typechecking to Conduit inputs at some point, and maybe we could improve the typing of output data when we do, too. This might have the effect of breaking you guys a bit, though. :/

The only practical way to deal with this right now might be to implement PHP rules for truthiness/falsiness, which makes all of "0", "", null, false and 0 falsey. Pretty blergh.

Thanks for the response. Sounds like you are mostly describing fixes for boolean values but the newValue is not a boolean. Output data typing could help, and breaking our stuff...well, it happens. ;-) Only it's somewhat worse for Phabricator where people could be running different versions (vs say Github). This is fixed in tenXer now though (not deployed yet).

Ah, you're right. The bool stuff is an issue in general, but the "status" case here is just general type dubmness, as with nearly every other field: dateCreated should be an integer, taskID should be an integer, comments being empty should be represented consistently (not both as null and "").

chad changed the visibility from "All Users" to "Public (No Login Required)".Jul 3 2015, 4:56 AM
eadler added a project: Restricted Project.Jan 9 2016, 1:06 AM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 4 2016, 9:15 PM
eadler removed a project: Restricted Project.Jul 21 2016, 7:18 PM
eadler added a project: Restricted Project.Aug 5 2016, 5:24 PM