Skip to content

Increase MAX_FRAME_SIZE by 4 bytes#2022

Open
weebl2000 wants to merge 1 commit intomeshcore-dev:devfrom
weebl2000:adjust-max-framesize
Open

Increase MAX_FRAME_SIZE by 4 bytes#2022
weebl2000 wants to merge 1 commit intomeshcore-dev:devfrom
weebl2000:adjust-max-framesize

Conversation

@weebl2000
Copy link
Contributor

@weebl2000 weebl2000 commented Mar 14, 2026

When a region is set, transport codes add 4 bytes to the wire format. For longer flood messages (~133+ chars for 14 char username), this pushes 1-hop repeat packets past the logRxRaw() limit of MAX_FRAME_SIZE - 3 (169 bytes). The raw packet gets silently dropped, so the companion app never sees repeats and can't show "heard repeats" for those messages.

Shorter messages and messages without a region set are unaffected because they stay under the limit.

Fix: bump MAX_FRAME_SIZE from 172 to 176 (the size of the transport code field). All frame buffers and size checks reference this constant so nothing else needs to change.

Memory cost is ~1 KB worst case across all queue buffers — negligible on all platforms.

This is the easiest fix for now without dropping region scoped messages by 10-16 bytes at worst.

Confirmed this fixes it for companions. First message is 1 byte over the limit with 173 bytes, second message is at the limit with 172 bytes, third message is after flashing with this fix and stays under 176 byte limit.

image

It's the safest fix for now to fix region scoped messages from being
dropped early
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.

1 participant