Page MenuHomePhorge

Avoid PhabricatorApplicationTransactionStructureException on editors not supporting Mute Notifications
ClosedPublic

Authored by aklapper on Jul 11 2024, 10:08.
Tags
None
Referenced Files
F3011399: D25730.1740662681.diff
Wed, Feb 26, 13:24
F3005568: D25730.1740530791.diff
Tue, Feb 25, 00:46
F2991918: D25730.1740198732.diff
Fri, Feb 21, 04:32
F2991917: D25730.1740198732.diff
Fri, Feb 21, 04:32
F2990368: D25730.1740177348.diff
Thu, Feb 20, 22:35
F2981954: D25730.1739943115.diff
Tue, Feb 18, 05:31
F2964142: D25730.1739311244.diff
Mon, Feb 10, 22:00
F2943573: D25730.1738204278.diff
Jan 29 2025, 02:31

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