Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Telegram and Twitch adapters panic when splitting long messages with multibyte characters

Open Beginner friendly
#661 0 comments 0 reactions 0 assignees View on GitHub

@RaphaelFakhri is already working on this.

Since Oct 22, 2026.

  • #662 by @RaphaelFakhri — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Read src/messaging/telegram.rs and src/messaging/twitch.rs, then compare their split_message implementations with the Discord, Slack, and Mattermost adapters referenced in the issue. Add or adapt tests in the two modules using the provided multibyte reproduction. Done means both adapters split at a UTF-8 character boundary without panicking.

Written by the indexing model from the issue text.

Description

split_message in src/messaging/telegram.rs and src/messaging/twitch.rs slices the reply at a fixed byte index (remaining[..max_len]). When a reply is longer than the platform limit and a multibyte UTF-8 character (for example é, €, CJK text, or emoji) spans that byte index, the slice panics:

byte index 4096 is not a char boundary; it is inside '€' (bytes 4095..4098)

The Discord, Slack, and Mattermost adapters already walk back to a char boundary before slicing (#49), but the Telegram and Twitch copies of split_message never got the same fix. PR #379 targeted the Telegram copy and was closed as already fixed, but current main still has the unchecked slice.

Impact

  • Telegram: any reply longer than 4096 bytes (or a formatted chunk that needs the 2048-byte re-split) with a non-ASCII character at the cut point panics in the send path, and the user never receives the reply.
  • Twitch: same for replies longer than 500 bytes.

Reproduction

// In either module's tests:
split_message("éééééééééé", 5); // panics: byte index 5 is not a char boundary

Expected behavior

The message splits at the nearest char boundary at or before max_len, as the other adapters do.

Dominant language
Rust
Stars
2.4k
Forks
382
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spacedriveapp/spacebot

All issues in spacedriveapp/spacebot

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.