Homec4science

Implement a basic version of ApplicationEditor in Paste

Authored by epriestley <git@epriestley.com> on Nov 3 2015, 03:58.

Description

Implement a basic version of ApplicationEditor in Paste

Summary:
Ref T9132. Ref T4768. This is a rough v0 of ApplicationEditor, which replaces the edit workflow in Paste.

This mostly looks and works like ApplicationSearch, and is heavily modeled on it.

Roughly, we define a set of editable fields and the ApplicationEditor stuff builds everything else.

This has no functional changes, except:

  • I removed "Fork Paste" since I don't think it's particularly useful now that pastes are editable. We could restore it if users miss it.
  • Subscribers are now editable.
  • Form field order is a little goofy (this will be fixed in a future diff).
  • Subscribers and projects are now race-resistant.

The race-resistance works like this: instead of submitting just the new value ("subscribers=apple, dog") and doing a set operation ("set subscribers = apple, dog"), we submit the old and new values ("original=apple" + "new=apple, dog") then apply the user's changes as an add + remove ("add=dog", "remove=<none>"). This means that two users who do "Edit Paste" at around the same time and each add or remove a couple of subscribers won't overwrite each other, unless they actually add or remove the exact same subscribers (in which case their edits legitimately conflict). Previously, the last user to save would win, and whatever was in their field would overwrite the prior state, potentially losing the first user's edits.

Test Plan:

  • Created pastes.
  • Created pastes via API.
  • Edited pastes.
  • Edited every field.
  • Opened a paste in two windows and did project/subscriber edits in each, saved in arbitrary order, had edits respected.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4768, T9132

Differential Revision: https://secure.phabricator.com/D14390

Details

Committed
epriestley <git@epriestley.com>Nov 3 2015, 19:11
Pushed
aubortJan 31 2017, 17:16
Parents
rPH1b00ef08a039: Remove some low-hanging buildStandardPageResponse() methods
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH105cbaaee1dd: Implement a basic version of ApplicationEditor in Paste (authored by epriestley <git@epriestley.com>).Nov 3 2015, 19:11