Page MenuHomePhorge

Avoid PhabricatorApplicationTransactionStructureException on editors not supporting Mute Notifications
ClosedPublic

Authored by aklapper on Jul 11 2024, 10:08.
Tags
None
Referenced Files
F3733505: D25730.1745748562.diff
Sat, Apr 26, 10:09
F3709501: D25730.1745655049.diff
Fri, Apr 25, 08:10
F3709416: D25730.1745651981.diff
Fri, Apr 25, 07:19
F3709373: D25730.1745649677.diff
Fri, Apr 25, 06:41
F3685754: D25730.1745571816.diff
Thu, Apr 24, 09:03
F3392865: D25730.1744491728.diff
Fri, Apr 11, 21:02
F3372908: D25730.1744254716.diff
Wed, Apr 9, 03:11
F3372014: D25730.1744247542.diff
Wed, Apr 9, 01:12

Details

Summary

Do not expose the "Mute Notifications" sidebar menu entry when the underlying Editor for that object type does not support muting notifications (means: creating a transaction of type "core:edge") at all.
This avoids a disappointing PhabricatorApplicationTransactionStructureException after two clicks.

Disabling the menu entry while still exposing it makes no sense here as the user could never get it enabled anyway.

EXCEPTION: (PhabricatorApplicationTransactionStructureException) Attempting to apply a transaction (of class "PhabricatorFileTransaction", with type "core:edge") which has not been constructed correctly: Transaction has type "core:edge", but that transaction type is not supported by this editor (PhabricatorFileEditor). at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1830]
EXCEPTION: (PhabricatorApplicationTransactionStructureException) Attempting to apply a transaction (of class "LegalpadTransaction", with type "core:edge") which has not been constructed correctly: Transaction has type "core:edge", but that transaction type is not supported by this editor (LegalpadDocumentEditor). at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1830]

Closes T15378

Test Plan
  • Open various different object types:
  • Click "Subscribe" on these various types of objects.
  • Click "Mute Notifications" on these various types of objects, remember which objects throw an exception.
  • Apply this patch.
  • Check that "Mute Notifications" is not exposed for those types of objects that threw an exception.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable