Skip to content

[#224] Resolve "require confirmation to DESTROY channel"

aguestuser requested to merge 224-require-confirmation-to-destroy-channel into master

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)
  • 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 to registrar.phoneNumber.destroy to catch it if it happens in prod, and move on!`
Edited by aguestuser

Merge request reports

Loading