Files uploaded to Panels don't get attached to object

What happened with files attaching to an object? It stopped working for Panels in dashboards…

If you upload file to Panel, it does not get “attached” and Object policy is not working then for that file. Attaching to other objects (Tasks, Wiki, etc.) works as expected and tab “Attached” appears correctly.

It seems that “connection” in phabricator_file.edge is missing. It can be done manually and then it works as expected.

Reproduction Instructions

Example on secure.phabricator.com

Dashboard https://secure.phabricator.com/dashboard/view/250/

Panel “W748 Test panel” that has policy

Visible To All Users
Editable by bbrdaric

File {F7021633} is uploaded to that panel and should be attached to that panel, get object policy from Panel (W748) and “Attached” tab view (that’s missing).


Phabricator/Arcanist Version
phabricator 9f7aaa8ee4cbd8c36c5cfb6e55e5366be4ff238c

and latest version on secure.phabricator.com

Thanks. I filed this upstream as https://secure.phabricator.com/T13456; it should be fixed by https://secure.phabricator.com/D20906.

(This fix isn’t retroactive, but making any edit to the panel text and saving the panel again should attach the file properly. You do have to make some kind of edit – just clicking “Save” again without a change to the text will treat the field as unchanged and skip updating.)

Thanks. This seems fine now, but in order to attach files properly, panel edit/save must be done by original uploader, otherwise there is no effect (if it’s done by administrator).

I also noticed inconsistent behaviour in Tasks/comments, editing content with unlinked file did not help and removing file reference from comment text or removing all comments with that file didn’t remove attach reference from file.

Yes. Specifically, the save/edit must be done by a user with permission to see the file. You can’t attach file X to object Y simply by making a comment with {X}, since this would let you see any file by writing {F1} {F2} {F3} ... in some comment somewhere.

I also noticed inconsistent behaviour in Tasks/comments, editing content with unlinked file did not help and removing file reference from comment text or removing all comments with that file didn’t remove attach reference from file.

Can you walk me through exactly what is inconsistent?

The expected behavior is that files never unlink, ever. Once a link is created, it is permanent.

You can still see the {F1234} text in the transaction history (for description edits) or the comment history (for comment edits), so we can’t unlink the file without breaking your ability to review history. Once a file is attached to an object, it remains attached forever.