Closed gilhrpenner closed 2 months ago
Hi @gilhrpenner thanks for writing in π―
I tried to implement this in a few different ways, but I was not able to successfully filter out reactions made to messages in thread, this seems to be limitation/bug, I've queried about this internally in an attempt to find a workaround
Hey @WilliamBergamin thanks for checking this
Hey @WilliamBergamin any updates on this? Users reactions on thread messages are eating through my premium workflow usage lol
A fix for this should be coming in the near future but I don't have any real ETA
The only work around I've been able to gather seems to leverage the message_link
attribute that does not seem to be documented, I have not had the time to test it out but the message_link
value will only contain a thread_ts
url param if the message is posted in a thread
Potentially a filter resembling something like {{data.message_link}} CONTAINS 'thread_ts='}}
may work but I haven't had a chance to test this out idea out yet
A fix for this should be coming in the near future but I don't have any real ETA
The only work around I've been able to gather seems to leverage the
message_link
attribute that does not seem to be documented, I have not had the time to test it out but themessage_link
value will only contain athread_ts
url param if the message is posted in a threadPotentially a filter resembling something like
{{data.message_link}} CONTAINS 'thread_ts='}}
may work but I haven't had a chance to test this out idea out yet
Thanks @WilliamBergamin !! It sort of works now, I am able to filter out thread reactions but with a single emoji, haven't been able to have an OR operator together
filter: {
version: 1,
root: {
operator: "AND",
inputs: [
{
operator: "NOT",
inputs: [{
statement: "{{data.message_link}} CONTAINS thread_ts",
}],
},
{
operator: "OR",
inputs: [
{ statement: "{{data.reaction}} == white_check_mark" },
{ statement: "{{data.reaction}} == eyes" },
{ statement: "{{data.reaction}} CONTAINS clock" },
],
},
],
},
},
2024-05-07 14:32:21 [error] [Wf070UBJPSJY] (Trace=Tr072SUCCPCZ) Trigger for workflow 'Message reactions workflow' failed: invalid_block
Am I doing this wrong or is it possibly a bug?
I've tried to implement this but I think the value of data.message_link
turns out to be null
,
I'm unsure why the failed: invalid_block
error is coming up, I've also seen it during my testing
Currently trying to identify how to access the variable referred to the Link to message that was reacted to
in the workflow builder
Let me know if you where successfully able to filter out messages from threads, this is the filter I was testing with
filter: {
version: 1,
root: {
operator: "AND",
inputs: [
{
operator: "NOT",
inputs: [{
statement: "{{data.message_link}} CONTAINS thread_ts",
}],
},
{ statement: "{{data.reaction}} == eyes" },
],
},
},
Hey @WilliamBergamin I was able to successfully filter out thread reactions, data.message_link is not being returned null for me.
Your filter works for me, it triggers the function when I react with π on the main message. The only issue is to be able to listen for multiple reactions
Hi @gilhrpenner the issue with the OR
nested inside an AND
is a bug on the backend, I am currently collecting more information on the bug
Thank you for bringing this forward π
Hi @gilhrpenner thanks again for bringing this up, this was a bug and a patch has been shipped, I've tested it this morning and the nested OR
in a AND
operator works on my end π
You may need to recreate your trigger, let me know if this resolves the issue
Hi @gilhrpenner thanks again for bringing this up, this was a bug and a patch has been shipped, I've tested it this morning and the nested
OR
in aAND
operator works on my end πYou may need to recreate your trigger, let me know if this resolves the issue
Hey @WilliamBergamin, thanks for the follow up!
I just tried on my end and although I am not getting the failed: invalid_block
error anymore I don't see my trigger function being called.
This is my filter
filter: {
version: 1,
root: {
operator: "AND",
inputs: [
{
operator: "NOT",
inputs: [{
statement: "{{data.message_link}} CONTAINS thread_ts",
}],
},
{
operator: "OR",
inputs: [
{ statement: "{{data.reaction}} == white_check_mark" },
{ statement: "{{data.reaction}} == eyes" },
{ statement: "{{data.reaction}} CONTAINS clock" },
],
},
],
},
},
If I remove the nested AND filter and have either NOT operator or OR it works fine but not both at the same time
Can you make sure that you've deleted and recreated your trigger this can be done with the following
slack trigger delete
slack trigger create
slack trigger update
will not be sufficient
Can you make sure that you've deleted and recreated your trigger this can be done with the following
slack trigger delete slack trigger create
slack trigger update
will not be sufficient
Yep, deleted and created the trigger, still not working
slack trigger delete
? Select a team digitalmga T8JU3LV0S
? Choose an app environment Local A0702H9CJEN
? Choose a trigger: Message reaction listener (local) Ft073XTYR4QG
ποΈ Trigger 'Ft073XTYR4QG' deleted
slack trigger create
? Select a team digitalmga T8JU3LV0S
? Choose an app environment Local A0702H9CJEN
β‘ Searching for trigger definition files under 'triggers/*'...
Found 5 trigger definition files
? Choose a trigger definition file: triggers/message_reactions.ts
β‘ Trigger successfully created!
Message reaction listener (local) Ft07391MHHL3 (event)
Created: 2024-05-13 17:07:58 -06:00 (0 seconds ago)
Collaborators:
Gil Penner @Gil Penner U03SELC8YKD
Can be found and used by:
everyone in the workspace
Hint:
Invite your app to the channel to receive the events
Warning:
Slack Connect channels are unsupported
slack run
? Choose a local environment digitalmga T8JU3LV0S A0702H9CJEN
Updating local app install for "APOLLO"
β‘ Listing triggers installed to the app...
π Scheduled triggers:
Daily job (local) Ft070BAW5YHM (scheduled)
Created: 2024-04-25 19:44:16 -06:00 (2 weeks ago)
Updated: 2024-05-06 23:10:14 -06:00 (6 days ago)
Collaborators:
Gil Penner @Gil Penner U03SELC8YKD
Can be found and used by:
everyone in the workspace
Weekly job (local) Ft072N33MTDG (scheduled)
Created: 2024-05-08 19:52:28 -06:00 (4 days ago)
Collaborators:
Gil Penner @Gil Penner U03SELC8YKD
Can be found and used by:
everyone in the workspace
π Shortcut triggers:
Request dev support (local) Ft070P0AVALD (shortcut)
Created: 2024-04-25 19:43:18 -06:00 (2 weeks ago)
Updated: 2024-05-03 10:52:49 -06:00 (1 week ago)
Collaborators:
Gil Penner @Gil Penner U03SELC8YKD
Can be found and used by:
everyone in the workspace
https://slack.com/shortcuts/Ft070P0AVALD/e9673b20ca4350072f22a083c4fad453
Manage tags (local) Ft072CSZ4LKX (shortcut)
Created: 2024-05-07 22:17:50 -06:00 (5 days ago)
Updated: 2024-05-07 22:54:57 -06:00 (5 days ago)
Collaborators:
Gil Penner @Gil Penner U03SELC8YKD
Can be found and used by:
everyone in the workspace
https://slack.com/shortcuts/Ft072CSZ4LKX/0d220aaf360fb047b8dbb2082195cb80
I can't remember but shouldn't the trigger be listed under the "Listing triggers installed to the app..."?
I see, I was able to reproduce your behavior
This does not seem like we completely fixed the issue
@gilhrpenner Yesterday a patched was deployed this should now work as expected
Let me know if it works on your end, I'll mark this issue as resolved
Hey @WilliamBergamin although I still can't see the trigger being listed under the trigger list I can confirm it's working!
Thank you so much for crushing this bug π
Question
Hello! Am trying to work on an event trigger that listens for message reactions but I would like to filter out all events on a thread message, so if user reacts a given emoji on main message of a thread it proceeds and if the message is a thread reply then it halts.
Context
Environment
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.