Skip to content

fix: decode hypr socket response after joining all chunks - #142

Open
8192KB wants to merge 1 commit into
caelestia-dots:mainfrom
8192KB:fix/hypr-socket-decode
Open

fix: decode hypr socket response after joining all chunks#142
8192KB wants to merge 1 commit into
caelestia-dots:mainfrom
8192KB:fix/hypr-socket-decode

Conversation

@8192KB

@8192KB 8192KB commented Aug 4, 2026

Copy link
Copy Markdown

My SUPER+M / SUPER+D toggle shortcuts stopped working intermittently, so I looked into the cause.

It turns out message() in hypr.py decodes each 8192-byte chunk from the socket as soon as it arrives, rather than waiting for the full response. Once the response exceeds 8192 bytes (which happens with enough windows open), the chunk boundary can fall in the middle of a multi-byte character in a window title (Korean, in my case), causing .decode() to raise an error before the command runs. I am not entirely certain why that specific boundary triggers it, but this matches what I observed.

The fix collects all chunks first and decodes once at the end, rather than decoding chunk by chunk.

I tested this by opening several windows and repeatedly triggering the toggle shortcut. It worked consistently after the fix, and I did not encounter any other issues.

@8192KB 8192KB changed the title jbTfix: decode hypr socket response after joining all chunks fix: decode hypr socket response after joining all chunks Aug 4, 2026
@sufficientpast

Copy link
Copy Markdown

toggle function of cli will be deprecated soon in favor of active lua version the function of it in dots

@soramanew

Copy link
Copy Markdown
Collaborator

toggle function of cli will be deprecated soon in favor of active lua version the function of it in dots

We still use the Hypr service in other parts of the cli however

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.

3 participants