slackapi / node-slack-interactive-messages

Slack Buttons, Menus, and Dialogs made simpler for Node
MIT License
133 stars 41 forks source link

Add handlerType to constraints #40

Closed aoberoi closed 6 years ago

aoberoi commented 6 years ago

Summary

Before this change when two handlers were registered for different kinds of requests (action and options), and an event was dispatched that met those constraints, the wrong handler could potentially be called. Since there was no way for the adapter to disqualify the first of the registered handlers, it would be selected, even if the payload for a different type of handler.

Also, the conditional checks done on the payload to determine if it was an action was incorrect. Dialog submissions do not have an actions property, so they were incorrectly treated as options requests.

Requirements (place an x in each [ ])

codecov[bot] commented 6 years ago

Codecov Report

Merging #40 into master will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   99.45%   99.47%   +0.01%     
==========================================
  Files           3        3              
  Lines         185      191       +6     
==========================================
+ Hits          184      190       +6     
  Misses          1        1
Impacted Files Coverage Δ
src/adapter.js 99.28% <100%> (+0.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1531f8f...da4cb6f. Read the comment docs.