SlackBridge: Slack links <url|label> arrive as broken text "url|label" (no link, no preview)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
Read apps/meteor/server/bridges/slack/RocketAdapter.ts, especially convertSlackMsgTxtToRocketTxtFormat around line 529, and compare its link handling with apps/meteor/server/lib/import/slack/SlackImporter.ts around lines 692–693. Check the existing bridge tests for this conversion, then verify that labeled Slack links render with the intended target and URL previews. An open linked pull request (#43590) already addresses this issue.
索引モデルが issue の本文から書いたものです。
説明
Description:
SlackBridge does not convert Slack's link markup <url|label>. It only strips the angle brackets, so every link with a label arrives in Rocket.Chat as the literal text url|label. The message parser then treats the whole url|label string as one URL, so the link points to a wrong address and no URL preview is fetched.
Slack sends almost every link this way. Pasted links are usually <https://x.com/user/status/123|x.com/user/status/123>, and links with custom text are <https://example.com|some text>. On our workspace, where most messages come through SlackBridge, this affected about 15,000 bridged messages.
Steps to reproduce:
- Set up SlackBridge between a Slack workspace and Rocket.Chat.
- In a bridged Slack channel, post a link, e.g.
https://x.com/user/status/123, or a link with custom text. - Look at the bridged message in Rocket.Chat.
Expected behavior:
<https://x.com/user/status/123|x.com/user/status/123>becomeshttps://x.com/user/status/123: a clickable link that gets a preview.<https://example.com|some text>becomes[some text](https://example.com).
Actual behavior:
The message text is https://x.com/user/status/123|x.com/user/status/123. The rendered link target is that whole string, and the message's urls contains it too, so the OEmbed lookup fails and no preview is shown.
Cause:
convertSlackMsgTxtToRocketTxtFormat in apps/meteor/server/bridges/slack/RocketAdapter.ts handles links with a single replace that keeps the |label part:
slackMsgTxt = slackMsgTxt.replace(/<(http[s]?:[^>]*)>/g, '$1');
The Slack importer already handles the same markup correctly:
message = message.replace(/<(http[s]?:[^>|]*)>/g, '$1');
message = message.replace(/<(http[s]?:[^|]*)\|([^>]*)>/g, '[$2]($1)');
Using the importer's two replacements in the bridge would fix the broken links. Two details from patching this locally:
- When the label is just the URL itself (Slack's usual case: the URL without scheme, or a shortened form with
…), emitting the bare URL is better than[label](url). The parser autolinks a URL-looking label inside the markdown link, and the bare form keeps previews working. - The link replacement runs after
>is decoded (line 522), so a label containing>gets cut at that character. Converting links before the HTML entity decode avoids this.
Server Setup Information:
- Version of Rocket.Chat Server: 8.9.1 (the same code is on
developat 7625d7c and in 9.0.0-rc.8) - License Type: Community
- Number of Users: 38
- Operating System: Linux (Ubuntu, kernel 6.8)
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: enabled (single-node replica set)
- NodeJS Version: 24.22.1
- MongoDB Version: 8.2.3
Client Setup Information
- Desktop App or Browser Version: any (the stored message text is wrong, so it does not depend on the client)
- Operating System: any
Additional context
We are running a locally patched image with this fix for now. I can open a PR if that would help.
Relevant logs:
No errors are logged; the conversion succeeds but produces the wrong text.
- 主要言語
- TypeScript
- スター
- 46.5k
- フォーク
- 14.1k
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 381
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RocketChat/Rocket.Chat のほかの issue
-
Mark the empty state busy while a new search loads, like the table */}対応中かも @aditya25bcy10173-a11y が 2 日前に担当しました。 オープンtodo type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RocketChat/Rocket.Chat#43699 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Timestamp with a time but no timezone shows as 1 January 1970対応中かも @Sarthak-agrawal-tech が 4 日前に担当しました。 オープンtype: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RocketChat/Rocket.Chat#43637 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
Move this mapping from useQuery's old `select` into a usePaginatedQuery `combine`対応中かも @aditya25bcy10173-a11y が 3 日前に担当しました。 オープンtodo type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RocketChat/Rocket.Chat#43609 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
evaluate switching to the other tab when the selected tab's permission is revoked mid-session対応中かも @schizophrenicmaniac が 4 日前に担当しました。 オープンtodo type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
RocketChat/Rocket.Chat#43579 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Docs say packages can be installed with `npm` but use unsupported `patch:` URL対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンtype: bug
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
RocketChat/Rocket.Chat#43554 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
RocketChat/Rocket.Chat の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/langchainjs#12239 ·
メンテナーはふだん 1 日以内に返信
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
paperclipai/paperclip#21837 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
code-yeongyu/senpi#6813 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 93/100
lingdojo/kana-dojo#34169 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100