Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] A MessagePosted trigger is not reliably calling the workflow. #348

Open
phil-kremidas-unitedmasters opened this issue Aug 1, 2024 · 6 comments
Labels
needs info not enough information to reproduce or continue

Comments

@phil-kremidas-unitedmasters

The deno-slack versions

phil@phils-mbp slack % cat import_map.json | grep deno-slack
    "deno-slack-sdk/": "https://deno.land/x/[email protected]/",
    "deno-slack-api/": "https://deno.land/x/[email protected]/"

Deno runtime version

phil@phils-mbp slack % deno --version 
deno 1.45.2 (release, x86_64-apple-darwin)
v8 12.7.224.12
typescript 5.5.2

OS info

phil@phils-mbp slack % sw_vers && uname -v
ProductName:            macOS
ProductVersion:         13.6
BuildVersion:           22G120
Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000

Describe the bug

I have the following trigger:

const respondWithGoLinksTrigger: Trigger<typeof RespondWithGoLinksWorkflow.definition> = {
  type: TriggerTypes.Event,
  name: "Golink Response",
  description: "Responds to messages that contain short links with clickable links.",
  workflow: `#/workflows/${RespondWithGoLinksWorkflow.definition.callback_id}`,
  event: {
    event_type: TriggerEventTypes.MessagePosted,
    all_resources: true,
    filter: {
      version: 1,
      root: {
        statement: "{{data.text}} CONTAINS um/",
      },
    }
  },
  inputs: {
    message: {value: "{{data.text}}"},
    channel: {value: "{{data.channel_id}}"},
    user: {value: "{{data.user_id}}"},
  },
};

This trigger sometimes gets called for new messages that contain the string "um/" and sometimes doesn't. When it does, the workflow behaves as expected. I would expect it to always get called for such messages. Here's an example interaction:

image

Steps to reproduce

  1. Write a workflow with the trigger above.
  2. Run or deploy it.
  3. Invite the bot user to a channel.
  4. Send a message containing the string "um/".

Expected result

The workflow should run.

Actual result

The workflow may or may not run.

@filmaj filmaj added the needs info not enough information to reproduce or continue label Aug 1, 2024
@filmaj
Copy link
Contributor

filmaj commented Aug 1, 2024

Hello @phil-kremidas-unitedmasters 👋

What kind of workspace do you experience this issue in? Standalone or as part of an enterprise grid? And you experience the issue in both deployed (slack deploy) and local run (slack run) environments? If so, would you say the rate of this issue occurring is roughly equal regardless of execution environment?

@phil-kremidas-unitedmasters
Copy link
Author

Hi @filmaj.

I think I'm in a standalone workspace, though I'm not totally sure how to check that. um-t.slack.com is the url if that helps.

This does happen both locally and deployed. At about the same rate.

@filmaj
Copy link
Contributor

filmaj commented Aug 1, 2024

Thanks for sharing that, yes indeed confirmed, a standalone workspace. Let me see if I can reproduce this...

@filmaj
Copy link
Contributor

filmaj commented Aug 1, 2024

So I couldn't reproduce this on my production standalone workspace. Both local run and deployed ran and the trigger ran every time, and I tried 50 times for each of local run and deployed. Some screens:

Screenshot 2024-08-01 at 12 20 10 PM Screenshot 2024-08-01 at 12 20 26 PM

As much as I hate to give you the runaround, I would suggest emailing our customer support team at [email protected] and ask them to look into the issue from your specific workspace's perspective. It may due to a particular setting for your workspace. It may be a rare workspace-specific bug. Customer support also is authorized to look into production customer data such as workflow execution logs to help debug the problem. Feel free to link to this issue along in your e-mail and mention that the SDK team (me) wasn't able to easily reproduce.

@phil-kremidas-unitedmasters
Copy link
Author

Yeah. I have another thread going with them. Thanks.

@rabraham-Cornerstone
Copy link

rabraham-Cornerstone commented Aug 20, 2024

I'm surprised your code works. Whenever I try to get the the actual text of the posted message it's blank. I tried like you:
message: {value: "{{data.text}}"}, and it's always an empty string.

My trigger always happens but the data.text isn't passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info not enough information to reproduce or continue
Projects
None yet
Development

No branches or pull requests

3 participants