Skip to content

Enforce size limit in publish()#258

Merged
FoamyGuy merged 1 commit into
adafruit:mainfrom
FoamyGuy:msg_size_limit
May 19, 2026
Merged

Enforce size limit in publish()#258
FoamyGuy merged 1 commit into
adafruit:mainfrom
FoamyGuy:msg_size_limit

Conversation

@FoamyGuy
Copy link
Copy Markdown
Contributor

Resolves #257

Adds a check and raise against the user configurable mqtt_msg property that holds a message size limit.

This change will help the AdafruitIO library have a better error behavior when attempting to publish a message that is too large.

I also think that mqtt_msg property name is kind of confusing for the size, but I have left it alone for now since changing would break the API. Though the properties value seemed to have no effect before this change anyhow.

@FoamyGuy FoamyGuy requested a review from brentru May 19, 2026 19:35
Copy link
Copy Markdown
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FoamyGuy LGTM and addresses the issue at-hand. If you want to go further on the msg, I think it's a valid concern, maybe that'd be best addressed in a subsequent PR.

@FoamyGuy FoamyGuy merged commit 400f295 into adafruit:main May 19, 2026
1 check passed
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 20, 2026
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.

Size limit logic issue

2 participants