[#224] Resolve "require confirmation to DESTROY channel"
Closes #224 (closed) and implements the behavior it describes.
Context
- we would like to give admins a chance to change their mind after issuing DESTROY (b/c it really does DESTROY everything!)
Changes
-
in
services.dispatcher.strings
:- create new DESTROY_CONFIRM command (and translations)
- create command response strings for
destroy.confirm
case (with translations)
-
in
execute.js
:- handle DESTROY by calling
maybeConfirmDestroy
(which responds with confirmation dialogue if sender is an admin) - hanndle CONFIRM_DESTROY by calling
maybeDestroy
(which destroys and notifies result if successful)
- handle DESTROY by calling
-
side-effect bug-fixes:
- shore up authentication protections around DESTROY command
- fix random bug causing DESTROY command response to wrongly report error when notification-sending fails even though DESTROY succeeded
- cause: something to do with getting an undefined error when trying to check the
messageExpiryTime
on a never-used and just-deleted channel - fix: instead of trying to sleuth too carefully, just add a defensive guard to that field check in
dispatcher.run.detectUpdatableExpiryTime
and a log statement toregistrar.phoneNumber.destroy
to catch it if it happens in prod, and move on!`
- cause: something to do with getting an undefined error when trying to check the
Edited by aguestuser