@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When a new, deleted, draft inline is revived with "Undo", undelete it

Summary:
See PHI1876. Normally, deleted inlines are undeleted with an "undelete" operation, which clears the "isDeleted" flag.

However, when an inline is deleted implicitly by using "Cancel" without first saving it, the flag currently isn't cleared properly. This can lead to cases where inlines seem to vanish (they are shown to the user in the UI, but treated as deleted on submission).

Test Plan:
There are two affected sequences here:

- Create a new inline, type text, cancel, undo.
- Create a new inline, type text, cancel, undo, save.

The former sequence triggers an "edit" operation. The subsequent "Save" in the second sequence triggers a "save" operation.

It's normally impossible in the UI to execute a "save" without executing an "edit" first, but "save" clearly should undelete the comment if you get there somehow, so this change clears the deleted flag in both cases for completeness.

- Executed both sequences, saw comment persist in preview, on reload, and after submission.

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

+6 -1
+6 -1
src/infrastructure/diff/PhabricatorInlineCommentController.php
··· 189 189 $inline->setIsEditing(false); 190 190 191 191 if (!$inline->isVoidComment($viewer)) { 192 + $inline->setIsDeleted(0); 193 + 192 194 $this->saveComment($inline); 193 195 194 196 return $this->buildRenderedCommentResponse( ··· 217 219 218 220 $is_dirty = false; 219 221 if (!$inline->getIsEditing()) { 220 - $inline->setIsEditing(true); 222 + $inline 223 + ->setIsDeleted(0) 224 + ->setIsEditing(true); 225 + 221 226 $is_dirty = true; 222 227 } 223 228