1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 01:12:41 +01:00
phorge-phorge/src/applications/phortune
epriestley a9ceebbdb1 Move all ApplicationTransaction publishing to daemons
Summary:
Ref T6367. Do all mail, feed, notification and search stuff from the daemons, in all editors.

There are four relatively-stateful editors (Audit, Differential, Phriction, PhortuneCart) which needed special care to move state into the daemons properly.

Beyond that, I moved mailTo/mailCC/feedRelated/feedNotify to be computed before we enter the worker:

  - This is simpler, since a lot of editors rely on being able to call `$object->getReviewers()` or similar to compute them.
  - This is more correct, since we want to freeze the lists at this moment in time.

Finally, I renamed `loadEdges` to `willPublish` and made it a slightly more general hook.

---

This is a bit fragile and I'm not //thrilled// about it.

It would probably be cleaner to have separate Editor and Publisher classes (something like @fabe's D11329 did). However, I think that's quite a lot of work, and I'd like to see stronger motivation for it (either in this actually being more fragile than I think, or there being other things we get out of it). Overall, I'm comfortable with this change, just definitely not a big fan of the "save" + "load" pattern since I think it's really fragile, nonobvious, hard to debug/predict, etc.

Test Plan:
Directly updated editors:

- Created a new Phriction page, saw "Document Content".
- Edited a Phriction page, saw "Document Diff".
- Edited a revision, got normal looking mail.
- Faked in `changedPriorToCommitURI` and verified it survived the state boundary.
- Sent Audit mail.
- Sent invoice mail.

Indirect editors - for these, I just made a change and made sure the mail generated:

- Updated a paste.
- Updated an event.
- Updated a thread.
- Updated a task.
- Updated a mock.
- Updated a question.
- Updated a project.
- Updated a file.
- Updated an initiative.
- Updated a Legalpad document.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, fabe

Maniphest Tasks: T6367

Differential Revision: https://secure.phabricator.com/D13115
2015-06-03 18:59:29 -07:00
..
application Support basic ad-hoc invoices in Phortune 2015-04-20 10:05:22 -07:00
capability Add Merchants to Phortune 2014-10-07 10:55:16 -07:00
cart Use PhutilInvalidStateException 2015-05-14 07:53:52 +10:00
constants Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
control phtize all the things 2015-05-22 21:16:39 +10:00
controller phtize all the things 2015-05-22 21:16:39 +10:00
currency phtize all the things 2015-05-22 21:16:39 +10:00
edge Give Phortune merchants explicit members 2014-10-13 11:13:50 -07:00
editor Move all ApplicationTransaction publishing to daemons 2015-06-03 18:59:29 -07:00
exception phtize all the things 2015-05-22 21:16:39 +10:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
management phtize all the things 2015-05-22 21:16:39 +10:00
phid Don't link payment methods to nowhere 2015-03-02 18:17:52 -08:00
product Support basic ad-hoc invoices in Phortune 2015-04-20 10:05:22 -07:00
provider phtize all the things 2015-05-22 21:16:39 +10:00
query Allow accounts and merchants to review unpaid invoices in Phortune 2015-05-04 11:06:09 -07:00
storage phtize all the things 2015-05-22 21:16:39 +10:00
subscription Allow subscriptions to decline to generate an invoice 2015-02-22 05:39:17 -08:00
view phtize all the things 2015-05-22 21:16:39 +10:00
worker phtize all the things 2015-05-22 21:16:39 +10:00