Page MenuHomePhabricator

Switch File deletion to use ModularTransactions
ClosedPublic

Authored by amckinley on Apr 18 2017, 7:23 PM.
Tags
None
Referenced Files
F19050018: D17723.id.diff
Thu, Nov 27, 6:47 PM
F19040291: D17723.diff
Wed, Nov 26, 12:10 PM
F18999411: D17723.id42628.diff
Thu, Nov 20, 9:01 PM
F18835816: D17723.id.diff
Oct 26 2025, 7:04 PM
F18831332: D17723.diff
Oct 25 2025, 12:21 PM
F18810803: D17723.id42628.diff
Oct 19 2025, 11:33 PM
F18808636: D17723.id42627.diff
Oct 19 2025, 7:38 AM
F18566198: D17723.id.diff
Sep 9 2025, 2:22 PM

Details

Summary

Fixes T12587. Adds a new PhabricatorFileDeleteTransaction that enqueues File delete tasks.

Test Plan
  • hack PhabricatorFileQuery to ignore isDeleted state
  • stop daemons
  • upload a file, delete it from the UI
  • check that the DB has updated isDeleted = 1
  • check timeline rendering in File detail view
  • start daemons
  • confirm rows are deleted from DB

Diff Detail

Repository
rP Phabricator
Branch
T12587 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16561
Build 22072: Run Core Tests
Build 22071: arc lint + arc unit

Event Timeline

epriestley added inline comments.
src/applications/files/controller/PhabricatorFileDeleteController.php
33

Maybe just use true to make the API a little more obvious later, unless you can come up with states we might have in the future other than "deleted" or "not deleted"?

src/applications/files/xaction/PhabricatorFileDeleteTransaction.php
17

You can omit save() here since the Editor calls it after calling all the applyInternalEffects() resolve -- basically it's doing:

foreach ($transactions as $xaction) {
  $xaction->applyInternalEffects($object, ...);
}
$object->save();
This revision is now accepted and ready to land.Apr 18 2017, 7:28 PM
amckinley added inline comments.
src/applications/files/controller/PhabricatorFileDeleteController.php
33

"Delete in progress"? in re: discussion in T12587

src/applications/files/controller/PhabricatorFileDeleteController.php
33

We might store a flag for that internally, but any API client would only ever say "delete this" or "cancel deleting this", I think -- there aren't three different values they could meaningfully pass that I can come up with, at least.

This revision was automatically updated to reflect the committed changes.