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

fix: Change slackapp to using scheduleMessage #4490

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

chriswk
Copy link
Contributor

@chriswk chriswk commented Aug 15, 2023

What

This PR changes the slack-app addon to use slack-api's scheduleMessage instead of postMessage.

Why

When using postMessage we had to find the channel id in order to be able to post the message to the channel. scheduleMessage allows using the channel name instead of the id, which saves the entire struggle of finding the channel name. It did mean that we had to move to defining blocks of content instead of the easier formatting we did with postMessage.

Message look

image

@chriswk chriswk self-assigned this Aug 15, 2023
@vercel
Copy link

vercel bot commented Aug 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2023 10:29am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 15, 2023 10:29am

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chriswk chriswk enabled auto-merge (squash) August 15, 2023 10:29
@chriswk chriswk merged commit 4ad3704 into main Aug 15, 2023
11 of 12 checks passed
@chriswk chriswk deleted the task/slackAppUseScheduleMessage branch August 15, 2023 10:29
chriswk pushed a commit that referenced this pull request Aug 15, 2023
This PR changes the slack-app addon to use slack-api's scheduleMessage
instead of postMessage.

When using postMessage we had to find the channel id in order to be able
to post the message to the channel. scheduleMessage allows using the
channel name instead of the id, which saves the entire struggle of
finding the channel name. It did mean that we had to move to defining
blocks of content instead of the easier formatting we did with
postMessage.

![image](https://github.com/Unleash/unleash/assets/177402/a9079c4d-07c0-4846-ad0c-67130e77fb3b)
nunogois added a commit that referenced this pull request Sep 14, 2023
https://linear.app/unleash/issue/2-1392/fix-flaky-unhandled-events

- Reverts part of #4490 and uses
`postMessage` instead. This prevents an error where scheduling the
message was flaky and some events ended up not being handled at all (see
screenshot below). As a bonus, this simplifies our code and prevents
having a delay. It seems like this method still works with the channel
name instead of needing an id, which was the main motivation towards the
changes in the aforementioned PR;
- Removes `FEATURE_UPDATED` from the event options for the Slack App
addon, as [this event is
deprecated](https://docs.getunleash.io/reference/environments#addons);
- Adds support for events without a specific project, including a test,
similar to #4672
 - Misc cleanups;


![image](https://github.com/Unleash/unleash/assets/14320932/3fcd085c-a60f-42f6-9739-b600db7a7cee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants