Repository navigation
Escape Markdown in Telegram notification titles - #599
Merged
Merged
Conversation
neSpecc
previously approved these changes
Oct 31, 2026
neSpecc
previously approved these changes
Nov 2, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An unresolved moderate finding remains: the project name is inserted raw inside a Telegram bold entity in event.ts and several-events.ts, so names containing Markdown characters can still cause a 400 error.
1 open issue
What changed in this PR
This PR fixes lost Telegram notifications. Event titles containing unbalanced _, *, ` or [ made Telegram reject the message with a "can't parse entities" error. The fix adds an escapeMarkdown helper and applies it to titles in the single-event and several-events templates.
Changes:
- Adds an
escapeMarkdownhelper in the Telegram event template and uses it for event titles. - Applies the same escaping to titles in the several-events template.
- Adds a unit test for escaping.
- Changes three fixed dates in the paymaster tests. This is not related to the PR's purpose.
| File | Description |
|---|---|
| workers/telegram/tests/provider.test.ts | Adds a test that checks escapeMarkdown output for _, *, ` and [. |
| workers/telegram/src/templates/several-events.ts | Escapes each event title before it is added to the grouped message. |
| workers/telegram/src/templates/event.ts | Adds the escapeMarkdown helper and applies it to the event title. |
| workers/paymaster/tests/index.test.ts | Changes three test dates to a fixed value. This change is unrelated to the Telegram fix. |
Review effort: Lite
neSpecc
approved these changes
Nov 2, 2026
Kuchizu
added a commit
that referenced
this pull request
Nov 2, 2026
* fix(javascript): keep backtrace coordinates when source map lookup misses (#601) source-map-js returns nulls for an unmapped position, and writing them onto the frame dropped the catcher location. * Escape Markdown in Telegram notification titles (#599) * Escape Markdown in Telegram notification titles * Pin current date in paymaster tests to avoid month overflow * Escape project name in Telegram notification footer --------- Co-authored-by: Peter <specc.dev@gmail.com> --------- Co-authored-by: Peter <specc.dev@gmail.com> Co-authored-by: Kuchizu <70284260+Kuchizu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Titles with unbalanced _ * ` [ made Telegram reject the message (400 can't parse entities), so about 20% of notifications were lost.