Page MenuHomePhorge

Fix broken file PHID extraction that causes Pholio uploads to crash
ClosedPublic

Authored by tiguchi on Oct 21 2022, 15:09.
Tags
Referenced Files
Unknown Object (File)
Fri, Apr 19, 02:07
Unknown Object (File)
Thu, Apr 11, 10:39
Unknown Object (File)
Wed, Apr 10, 18:05
Unknown Object (File)
Sun, Apr 7, 05:37
Unknown Object (File)
Mon, Apr 1, 00:48
Unknown Object (File)
Mon, Apr 1, 00:48
Unknown Object (File)
Mon, Apr 1, 00:48
Unknown Object (File)
Sun, Mar 31, 14:06

Details

Summary

A commit earlier this year modified the structure of the file upload transaction data value, by nesting the array of file upload PHIDs in another array.
The extractFilePHIDs method was not updated to deal with that change though, therefore new mock uploads via Pholio would crash.
This patch fixes that method so it can process the updated transaction data.

Resolves T15105

Test Plan

Patched my live Phabricator installation with this fix and successfully uploaded new Pholio mockups.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tiguchi requested review of this revision.Oct 21 2022, 15:09

The harbormaster has passed and you have properly fixed the bug.

NOTE: This revision is not ready to land because I am not a member of Blessed Committers. It will be ready to land once accepted by members of Blessed Committers.

@tiguchi you don't have to add reviewers yourself.

Well, I did ask for this to be converted into a revision, so I'm OK getting added as a reviewer. Sorry for the delay, I've been on vacation.

This revision is now accepted and ready to land.Nov 11 2022, 20:09

After your change, it seems Evan fixed this as well, but with a different approach:

https://secure.phabricator.com/rPa83cb99e856a70ac355dc51547949b50485bb768

It seems Evan created an array indexed by PHID, so to don't process a PHID twice I think

src/applications/pholio/xaction/PholioImageFileTransaction.php
110–118

Note that Evan fixed with this version ↑

https://secure.phabricator.com/rPa83cb99e856a70ac355dc51547949b50485bb768

I post this comment so we can compare

src/applications/pholio/xaction/PholioImageFileTransaction.php
110–118

We should probably update to match. I agree it's likely the upstream fix was done to avoid loading a pholio image multiple times.