-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 mattermost couldn't find channel issue #1298
Conversation
@louislam first of all kudos on Uptime-Kuma, it is a fantastic tool and really helpful for monitoring critical services in private cloud. There are very few tools in this space. When i started using this tool, if found that Mattermost alerts did not get delivered. Hence I wanted to raise and issue, but saw we already had few open issues addressing this problem. So I started debugging via logs and found the problem, the change is very minor but wanted to be part of your journey with Uptime-Kuma :) |
@@ -20,7 +20,7 @@ class Mattermost extends NotificationProvider { | |||
return okMsg; | |||
} | |||
|
|||
const mattermostChannel = notification.mattermostchannel; | |||
const mattermostChannel = notification.mattermostchannel.toLowerCase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believed that it should be .toLowerCase() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is correct my bad, fixed the same.
@louislam is the fix already included in v1.11.4? Because we still receive:
|
No, it was fixed after 1.11.4. |
Thanks @louislam, so we will wait for the next release :-) |
The channel name is not a required field, but if you leave it empty your bug fix leads into: Cannot send notification to Mattermost
edit: the channel name isn't used in the test case that's why both cases behave in a different way |
Description
The Mattermost integration currently has a small problem, which is if the name of the channel include Upper Case letters like
Uptime-Alerts
the backend will trigger a "Couldn't find the channel" error. This happens because the Mattermost expects the channel name in url in Lower Case asuptime-alerts
.People who use lower case letters for channels will not face this issue, but people who use Upper Case in channel will get above error.
Fixes #(issue)
Type of change
Checklist
Screenshots (if any)
Error Trace from logs:
Mattermost Link Sample:
https://mattermost.example.com/devops/channels/uptime-alerts
https://mattermost.example.com/devops/channels/Uptime-Alerts