Page MenuHomePhorge

Profile picture destroy: implement Before-Destruction engine to restore the builtin image
Needs ReviewPublic

Authored by valerio.bozzolan on Mon, May 19, 22:35.

Details

Summary

When you destroy a profile picture from the command line, now that picture
does not cause anymore a 404 error on your user page. So, you do not see
anymore this problem:

profile-picture-404-error.jpg (461×419 px, 26 KB)

Instead, you just see your exciting builtin image, fully operational.

This will be even more useful in a future when users could be able to delete
their own profile pictures (T15407), and this would happen in a safe way,
without causing any website damages.

This feature works thanks to the brand-new "Before-Destruction Engine",
described in T16079.

Closes T16074
Closes T16078
Ref T15407
Ref T16079

Test Plan

As indicated in T16074, set your profile picture by uploading an image,
then, destroy it from the command line:
You do not see anymore a broken user image, but a lovely builtin image.

Diff Detail

Repository
rP Phorge
Branch
before-destruction-engine
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1997
Build 1997: arc lint + arc unit

Event Timeline

I need to test this still, but this looks good. Two nits, and one issue I spotted:

src/applications/files/query/PhabricatorFileAttachmentQuery.php
91
src/applications/people/engineextension/PeopleProfilePictureBeforeDestructionEngineExtension.php
70
83