zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.7k stars 7.92k forks source link

Fix incorrectly formatted links in Mastodon notifications via Zapier bot integration. #30573

Open PieterCK opened 5 months ago

PieterCK commented 5 months ago

Bug Overview

Sometimes the Mastodon notification over at #mastodon channel sends messages containing links that have extra whitespaces in it thus breaking the link. The Mastodon integration is set up via our Zapier integration bot.

Instances of notification with buggy links from the Mastodon integration: ![image](https://github.com/zulip/zulip/assets/108744694/59751046-be93-4184-86c7-5455ee9db2d8) ![image](https://github.com/zulip/zulip/assets/108744694/b1c3593c-8f00-45e2-b48d-231eae211d95) ![image](https://github.com/zulip/zulip/assets/108744694/9ad2c3d8-d58c-48e2-b4d0-60e90a499bc2) ![image](https://github.com/zulip/zulip/assets/108744694/7f0500ac-987d-41d8-9921-0df18306088e) > Notes: there are plenty more examples over at the Mastodon channel, please check them out for more references

Leads

Our Zapier webhook bot is only forwarding messages from Zapier. In the backend, we didn't do any formatting at all for any incoming messages to the Zapier bot. Over at the front end, I couldn't find features or quirks that might incorrectly format links. This leads me to think that it might be a problem from upstream over at Zapier or Mastodon.

If we go to the original post from these notifications with broken links, we can see that the links in the actual Mastodon post are displayed without the "https:" part and if it's too long, the links are also truncated. Over at our side, these same links are added the "https:" part and the truncated section is added back. However, these are white spaces between these added parts that breaks the link. This is a consistent pattern across the messages with broken links.

Further investigation and reproducing the bug might be warranted.

Original Mastodon posts of the notifications above: ![image](https://github.com/zulip/zulip/assets/108744694/1ae9539d-67c3-41e9-9062-aa208269f9a6) ![image](https://github.com/zulip/zulip/assets/108744694/ad01b875-caff-4120-a73f-d5a1cbc66a07) ![image](https://github.com/zulip/zulip/assets/108744694/f0139010-ad43-48b8-bc72-3f075af1bf8f) ![image](https://github.com/zulip/zulip/assets/108744694/cd860a74-5d11-4237-8686-ce6062ea9abd) > Note: the links to the original Mastodon post are also in the notification sent by the Zapier bot
**Zulip Server and web app version:** - [ ] Zulip Cloud (`*.zulipchat.com`) - [ ] Zulip Server 8.0+ - [ ] Zulip Server 7.0+ - [ ] Zulip Server 6.0+ - [ ] Zulip Server 5.0 or older - [x] Other or not sure
PieterCK commented 5 months ago

@zulipbot add "area: integrations"

zulipbot commented 5 months ago

Hello @zulip/server-integrations members, this issue was labeled with the "area: integrations" label, so you may want to check it out!

Faisal-imtiyaz123 commented 4 months ago

@alya can I work?

alya commented 4 months ago

@Faisal-imtiyaz123 Sure! Please post a comment describing your proposed approach when you're ready. You can claim the issue after you have a rough plan for how to address it. Thanks!

gaurav21687 commented 2 months ago

Hey @alya , I have completely understood the issue and am interested to work on the issue. I am a beginner , so can you please guide me how should i approach the problem.

gaurav21687 commented 2 months ago

@zulipbot claim

zulipbot commented 2 months ago

Welcome to Zulip, @gaurav21687! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

alya commented 2 months ago

@gaurav21687 Please refer to our guide to asking great questions for some tips on how to get help figuring out how to approach an issue. It's very difficult to answer general questions along the lines of, "how do I get started?" Thanks!

Faisal-imtiyaz123 commented 2 months ago

@zulipbot claim

zulipbot commented 2 months ago

Hello @Faisal-imtiyaz123, it looks like you've currently claimed 1 issue in this repository. We encourage new contributors to focus their efforts on at most 1 issue at a time, so please complete your work on your other claimed issues before trying to claim this issue again.

We look forward to your valuable contributions!

OmarAmeen01 commented 1 month ago

@zulipbot claim

devyk100 commented 1 month ago

@zulipbot claim

zulipbot commented 1 month ago

Welcome to Zulip, @devyk100! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!