Commit e12d402
authored
Fix slack interactions by normalising emoji text (#1600)
Fixes OPS-2996.
## Additional Notes
Button text is being normalised by Slack in the response payload and
this lead to the conflict to resume the flow. Now we match the
normalised text response from slack with the normalised original action
text and then we return the original text in the updated message.
For multi select, we are already sending the userSelection.value which
slack doesn't normalise and need not be fixed.
## For future reference
- I've first added emoji: false prop to SlackText and although this
fixes the bug, Slack wouldn't render emojis in the UI when user uses
emoji in colon notation like ":emoji:"
- I've then tried normalisation in request action and then compare it
with original action in wait for interaction and then send the emojified
string back to the user.
- We've decided to send back the original text (either emoji or text
notation) to the user.
- So I've moved the normalisation to wait for interaction module and
return the original action to the user. For multi - select (Arrays), we
already return the value prop which slack doesn't normalise.
- As as alternate fix, I've tried
#1615, but this would
require user to add value prop for actions when using send message
action. So we ignore this method although it would've been the cleanest
approach.1 parent 5370bb6 commit e12d402
9 files changed
Lines changed: 675 additions & 13 deletions
File tree
- packages
- blocks/slack
- src/lib/common
- test
- server/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8011 | 8011 | | |
8012 | 8012 | | |
8013 | 8013 | | |
| 8014 | + | |
| 8015 | + | |
| 8016 | + | |
| 8017 | + | |
| 8018 | + | |
| 8019 | + | |
| 8020 | + | |
| 8021 | + | |
| 8022 | + | |
| 8023 | + | |
| 8024 | + | |
| 8025 | + | |
| 8026 | + | |
| 8027 | + | |
| 8028 | + | |
| 8029 | + | |
| 8030 | + | |
| 8031 | + | |
| 8032 | + | |
| 8033 | + | |
| 8034 | + | |
| 8035 | + | |
| 8036 | + | |
| 8037 | + | |
| 8038 | + | |
| 8039 | + | |
| 8040 | + | |
| 8041 | + | |
| 8042 | + | |
| 8043 | + | |
| 8044 | + | |
8014 | 8045 | | |
8015 | 8046 | | |
8016 | 8047 | | |
| |||
16716 | 16747 | | |
16717 | 16748 | | |
16718 | 16749 | | |
| 16750 | + | |
16719 | 16751 | | |
16720 | 16752 | | |
16721 | 16753 | | |
| |||
25618 | 25650 | | |
25619 | 25651 | | |
25620 | 25652 | | |
| 25653 | + | |
25621 | 25654 | | |
25622 | 25655 | | |
25623 | 25656 | | |
| |||
25757 | 25790 | | |
25758 | 25791 | | |
25759 | 25792 | | |
| 25793 | + | |
25760 | 25794 | | |
25761 | 25795 | | |
25762 | 25796 | | |
| |||
26044 | 26078 | | |
26045 | 26079 | | |
26046 | 26080 | | |
| 26081 | + | |
| 26082 | + | |
| 26083 | + | |
| 26084 | + | |
| 26085 | + | |
| 26086 | + | |
| 26087 | + | |
| 26088 | + | |
| 26089 | + | |
| 26090 | + | |
| 26091 | + | |
| 26092 | + | |
| 26093 | + | |
| 26094 | + | |
| 26095 | + | |
| 26096 | + | |
| 26097 | + | |
| 26098 | + | |
| 26099 | + | |
| 26100 | + | |
| 26101 | + | |
| 26102 | + | |
| 26103 | + | |
| 26104 | + | |
| 26105 | + | |
| 26106 | + | |
| 26107 | + | |
| 26108 | + | |
| 26109 | + | |
| 26110 | + | |
26047 | 26111 | | |
26048 | 26112 | | |
26049 | 26113 | | |
| |||
28574 | 28638 | | |
28575 | 28639 | | |
28576 | 28640 | | |
| 28641 | + | |
| 28642 | + | |
| 28643 | + | |
| 28644 | + | |
| 28645 | + | |
| 28646 | + | |
| 28647 | + | |
| 28648 | + | |
| 28649 | + | |
| 28650 | + | |
| 28651 | + | |
| 28652 | + | |
| 28653 | + | |
| 28654 | + | |
| 28655 | + | |
| 28656 | + | |
| 28657 | + | |
| 28658 | + | |
| 28659 | + | |
| 28660 | + | |
| 28661 | + | |
| 28662 | + | |
| 28663 | + | |
| 28664 | + | |
| 28665 | + | |
| 28666 | + | |
| 28667 | + | |
| 28668 | + | |
| 28669 | + | |
| 28670 | + | |
28577 | 28671 | | |
28578 | 28672 | | |
28579 | 28673 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
122 | | - | |
| 130 | + | |
123 | 131 | | |
124 | 132 | | |
125 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
0 commit comments