pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

[BUG] Slack direct message interpolation doesn't work for `$`

Open joscha opened this issue 1 year ago • 5 comments

Describe the bug When using the slack direct message action and using a value from a previous step that has a dollar sign ($) in it, the interpolation doesn't work and it throws an error

To Reproduce Steps to reproduce the behavior:

  1. Create a workflow
  2. Add a Slack direct message action
  3. add an interpolation to the Text field that contains a $, e.g. {{steps.my_step.$return_value}}
  4. Run it

Expected behavior It should interpolate and THEN send the message further to the Slack API.

Escaping in any way, e.g. {{steps.my_step.\$return_value}} doesn't seem to make a difference.

I can't actually find the interpolation code in this repository here, it might be closed source as it's part of the product itself. Given that other interpolations with {{}} work, my assumption is that somewhere it doesn't match $ correctly.

Screenshots

Setup:

scan_-_Build_-_Pipedream

error:

scan_-_Build_-_Pipedream

joscha avatar May 16 '24 23:05 joscha

@joscha, would you mind sharing the whole text of your Text prop if possible?

I couldn't seem to reproduce your issue (given to reproduce steps that you provide)

image

vunguyenhung avatar May 17 '24 16:05 vunguyenhung

@vunguyenhung you can see the full text in the screenshot above (except for a sensitive URL which I have masked). Can you try this text? The URL itself without the interpolation containing $ works, so I don't suspect this to be the issue, but if you can still not reproduce it, I can send you the workflow ID via the pipedream support channel.

Update: I also noticed that there is an array access ([0]) in the same interpolation, maybe that makes a difference in combination with the $ and the error message is just not precise?

joscha avatar May 18 '24 07:05 joscha

@joscha Would escaping the backticks like this works for you?

* 🔎 scan of \`{{steps.code.$return_value}}\` started * - <http://www.example.com|This message *is* a link>

image

vunguyenhung avatar May 18 '24 07:05 vunguyenhung

@joscha Would escaping the backticks like this works for you?

Oh, I wasn't aware the back ticks needed to be escaped. Apologies I had missed that they could be an issue. I assumed they'd be sent verbatim as the text block was going to be processed. Escaping is not a problem at all, will the text still show up as inline code in Slack? And can you make sense of the error message relating to the $? If this error message is constructed by pipedream it might make sense to improve it?

joscha avatar May 18 '24 07:05 joscha

@joscha the text shown like this in Slack (given my example) image

And can you make sense of the error message relating to the $? If this error message is constructed by pipedream it might make sense to improve it?

This is related to Pipedream internals. Maybe @ctrlaltdylan has more context.

Hey @ctrlaltdylan, when you have time, could you do a check to see if we can improve this?

vunguyenhung avatar May 18 '24 08:05 vunguyenhung

Without more information, I'm going to close this issue. Feel free to reopen and add more details, if you'd like.

dylburger avatar Jun 15 '24 23:06 dylburger