[bugfix] healthcheck responses wrongly triggering channel redemption
- BUG: at random intervals after issuing destruction requests, all channels enqueued for destruction were redeemed all at once despite no messages having been sent by admins on the channel. (channels are only supposed to be redeemed from destruction if admins send a message within the 24 hour "destruction grace period" after the destruction request is issued)
- CAUSE:
- healthcheck responses (which go out every 10 minutes) were being incorrectly interpreted as messages on the channale
- reason: to fix a bug we had returned early for expiring message
udpate messages without processing the expiry update (caused by
processSideEffects
being called afterreturn if .. _isEmtpy
), we recently moveddispatcher#processSideEffects
above the (early-returning)dispatcher#processInterventions
. however, this caused theredeem
call to happen after the call todetectHealthcheckResponse
, which used to trigger an early return, which used to prevent health check responses from being interpreted as redemption messaeges
- FIX:
- in order to fix this bug but not introduce a regression in expiry
time handling, we call
dispatcher#processSideEffects
after#processInterventions
(to preserve early returns on healthcheck responses) but before the early-returning call to_isEmpty
(to preserve expiry udpate handling) - we also introduce more unit tests to
dispatcher/index.spec
to catch future regressions and make it less important to keep all this stuff straight to avoid introducing bugs
- in order to fix this bug but not introduce a regression in expiry
time handling, we call