Skip to content

fix: stop repeated messages accumulating spaces - #1266

Merged
flex3r merged 2 commits into
flex3r:developfrom
3r01:fix-repeated-message-spacing
Oct 6, 2026
Merged

flex3r merged 2 commits into
flex3r:developfrom
3r01:fix-repeated-message-spacing

Conversation

@3r01

@3r01 3r01 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor
00:12 imfakeris1_: dankchat had spacing issues since 4.0.37 if it's the same message
00:12 imfakeris1_: Iore
00:12 imfakeris1_: forsenE forsenE forsenE […]
00:12 imfakeris1_: forsenE  forsenE forsenE […]
00:12 imfakeris1_: forsenE   forsenE forsenE […]
00:12 imfakeris1_: forsenE    forsenE forsenE […]
00:12 imfakeris1_: forsenE     forsenE forsenE […]
00:12 imfakeris1_: forsenE      forsenE forsenE […]
00:12 imfakeris1_: forsenE       forsenE forsenE […]
00:12 imfakeris1_: forsenE        forsenE forsenE […]
00:12 imfakeris1_: forsenE         forsenE forsenE […]
00:12 imfakeris1_ has been timed out for 25s.
00:13 imfakeris1_: @Iore if you look at my logs, there is a space after space from the same message until you get a timeout docRant

[...] replaced repeating forsenE. The timeout was for message height in forsen’s chat, repeatedly sending the same message adds another space after the first word each time so the message gets progressively longer.

This PR instead cycles one additional space through the gaps then loops back to the original:

forsenE forsenE forsenE
forsenE  forsenE forsenE
forsenE forsenE  forsenE
forsenE forsenE forsenE

Now it gains at most one extra space.

I'm not sure if the accumulating spaces were added for a specific reason but if so let me know and I'll try to cover that use case as well.

@3r01
3r01 force-pushed the fix-repeated-message-spacing branch from ab63e9d to 33e148a Compare October 3, 2026 01:27
@3r01
3r01 force-pushed the fix-repeated-message-spacing branch from 33e148a to f273384 Compare October 4, 2026 22:29
@flex3r

flex3r commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Nice catch! Cycling through every gap shouldn't be necessary though, Twitch only compares against the previous message so alternating is enough (same as Chatterino). Maybe something like:

val previousSentMessage = chatEventProcessor.getLastMessage(channel)
return when (previousSentMessage) {
    trimmedMessage -> applyAntiDuplicate(trimmedMessage)
    else -> trimmedMessage
}

@3r01

3r01 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Nice catch! Cycling through every gap shouldn't be necessary though, Twitch only compares against the previous message so alternating is enough (same as Chatterino). Maybe something like:

I wasn't sure if you wanted more variants of the duplicates (maybe for r9k mode, which does compare across the last 30 seconds iirc), which you get for free with this cycling, but it sounds like that isn't the intention so I will simplify.

@flex3r
flex3r merged commit 1771627 into flex3r:develop Oct 6, 2026
4 checks passed
@3r01
3r01 deleted the fix-repeated-message-spacing branch October 6, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants