HomePhabricator

Improve display behavior for write locks held by omnipotent users

Description

Improve display behavior for write locks held by omnipotent users

Summary:
Ref T13614. When an omnipotent user calls "synchronizeWorkingCopyBeforeWrite()", we record a WorkingCopyVersion record with a null "userPHID". The UI then renders this as "Unknown Object (????)".

Improve this behavior:

  • When no PHID is available, just render nothing in the UI (this doesn't seem meaningfully different from no version existing at all).
  • Allow callers to provide an acting user PHID, similar to Editor.

There's currently no way to perform this kind of write legitimately in the upstream, but T13614 is providing one.

Test Plan:

  • Wrote a script that calls "synchronizeWorkingCopyBeforeWrite()" as the omnipotent user.
  • Ran script, saw "Unknown Object (????)" in the UI.
  • Applied UI fix, saw empty UI.
  • Applied "acting as" fix, modified script to act as the Diffusion application, ran script, saw "Diffusion" attribution in UI.

Screen Shot 2021-06-01 at 6.12.01 AM.png (131×374 px, 8 KB)

Maniphest Tasks: T13614

Differential Revision: https://secure.phabricator.com/D21669