Skip to content

[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 after return if .. _isEmtpy), we recently moved dispatcher#processSideEffects above the (early-returning) dispatcher#processInterventions. however, this caused the redeem call to happen after the call to detectHealthcheckResponse, 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

Merge request reports

Loading