Page MenuHomePhabricator

Unhandled exception due to policies when creating a task
Closed, ResolvedPublic

Description

When creating a task with visibility set to Administrators and editable by set to administrators I was presented with an exception error due to validation errors:

Unhandled Exception ("PhabricatorApplicationTransactionValidationException")
Validation errors:

  • You can not select this view policy, because you would no longer be able to view the object.
  • You can not select this edit policy, because you would no longer be able to edit the object.

Event Timeline

strayobject updated the task description. (Show Details)
strayobject added a project: Maniphest.
strayobject changed the visibility from "Public (No Login Required)" to "All Users".
strayobject added a subscriber: strayobject.
epriestley claimed this task.
epriestley changed the visibility from "All Users" to "Public (No Login Required)".
epriestley added a subscriber: epriestley.

This is expected, and working as intended. You can not create objects which you could not view or edit.

Again, as in the other unhandled exception, I'm no expert, but I would consider sending 500 to a user a very bad practice.

Also, while understandable that "You can not create objects which you could not view or edit.", why would you let me in the first place? Why is 'admin only' even available to me? That leads to a bad user experience.
User gets a 500 with an exception and when he/she goes back to the previous page 5 or 10 or 15 minutes of their life has been wasted because the content of the task is nowhere to be found.

The handling of this error will be improved by T9132.

Broadly, we show users options they can not actually select (a) to increase the consistency of the UI and (b) because we can not evaluate whether they are selectable ahead of time (the evaluation of some policies depends on other fields on the object, or on external state).

I can't reproduce the data loss issue: pressing "back" restores all the information for me in Safari, Firefox and Chrome. If you can reproduce this, please file a separate bug with reproduction instructions, including which browser you're using.