How an Slack feature caused a day of debugging

If you don’t want to read the full post you can go see the Cause of the problem and the Solution
A day like any other day I received a ticket to check why our links, when shared on a chat do not have a preview, this would have sound like an easy ticket but a few days ago we deployed a big feature, which caused all fingers were pointing to the new release. As you might have guess, it endup being an stresful day, actually more than one day.
It was informed that a web automation tool was used to check previews was not working either.
[!info] Link previews for development environments were working, only production was failing.
While investigating the issue I quickly discovered that it was cause by our CDN image optimization in combination with our website favicon, looks like the CDN was blocking any attemp from the social chat preview to load the favicon. The fix was easy, simply serve the favicon from another source than the CDN and in less than 20 minutes we had a new version of the website running. e.g.
From:
<link rel="icon" type="image/x-icon" href="https://CDN.andrevops.com/img/favicon.png">
To:
<link rel="icon" type="image/x-icon" href="https://andrevops.com/favicon.png">
[!info] The favicon size was changed from 192x192 to 32x32px, saving like 80% image size.
After the changes were deployed I was able to check the links on several social chats were working. Also discovered the Web automation tool has a browser extention that allowed me to confirm the link preview was working. e.g.
I thought it was resolved but it was just the beginning.
The main problem was solved indeed with the favicon fix but there was another issue that no one complained before until that moment. The previews were not working on Slack.
At this point I was almost confident that the issue was not on our side but they claimed the Slack chat preview was an important feature and they need it working as soon as possible and I continued checking the code to confirm all the metadata were set, I found that some values were not set and deploy a new version, you guess? Slack still not working.
I was told the image added was pointing to a relative path - Introduced 4 years ago - and should point to the full path. Applied!! Did not work.
From:
<meta property="og:image" content="/preview_image.png">
To:
<meta property="og:image" content="https://andrevops.com/preview_image.png">
Cause⌗
At this point I was 100% sure the issue was not on our side and decided to investigate other possible reasons without any luck until the evening of that day. Slack has a feature only available for Admins/Owners (not me) that allows to block the links preview for everyone.
As admin, when removing the preview of a link after an url is sent, you are allowed to block the specific link or the domain..
After scalating the issue to an admin, we were able to see the preview of the links. The funny part is not that an admin external to the team blocked the link - Probably unintentionally -, the real fun here is that they claimed the feature was super important but it was actually blocked almost one month before as we could validate the date in the admin.
[!question] What happened with the Web automation tool? Easy. The firewall set in the past has a bot behavior rule and the requests were matching it.
Solution⌗
How to enable links preview on Slack
- Tools & settings > Workspace settings.
- Attachments tab.
- Blocked previews
Get quality content updates subscribing to the newsletter, Zero Spam!