Repository navigation
fix(sqs): MaximumMessageSize default is 1 MiB, not 256 KiB (#439) - #450
Merged
Merged
Conversation
GetQueueAttributes reported 262144 (256 KiB) for a queue created without the attribute. That is the historical limit; the current CreateQueue reference documents 1,048,576 bytes (1 MiB) as the default. A consumer sizing a payload against what substrate reported was working from a number a real queue would not give it. An explicitly requested value is still honored — 256 KiB remains a legal size, it is simply no longer the default. Both default sites moved together and now share one constant: getQueueAttributes' inline fallback, and the defaults CreateQueue's conflict check (#429) resolves an existing queue's unset attributes through. A named constant makes divergence structurally impossible rather than merely tested, which matters because a divergence reports one number and then rejects a re-create naming exactly that number as QueueNameExists. The idempotent re-create test covers it either way. Substrate still does not enforce MaximumMessageSize on SendMessage; no length check exists against the attribute or any constant. That absence is deliberate here and documented — enforcement is a new error path with its own scope.
scttfrdmn
force-pushed
the
feat/439-sqs-max-message-size
branch
from
August 1, 2026 18:10
78520ad to
60b43b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 1, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #439.
The defect
GetQueueAttributesreported262144(256 KiB) asMaximumMessageSizefor a queue created without the attribute. That is the historical limit; the current CreateQueue reference documents "An integer from 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 bytes (1 MiB)".A consumer sizing a payload against what substrate reported was working from a number a real queue would not give it. Filed while implementing #429, which left a
TODO(#439)pointing here — now removed.An explicitly requested value is still honored: 256 KiB remains a legal size, it is simply no longer the default.
Both sites move together
The default exists twice, deliberately:
sqs_plugin.go—getQueueAttributes' inline fallback (the read path).sqs_createqueue.go—sqsAttributeDefaults, whichCreateQueue's conflict check (SQS: CreateQueue never raises QueueDeletedRecently or QueueNameExists #429) resolves an existing queue's unset attributes through before comparing.They mirror each other so the two cannot disagree about a queue's effective attributes. A divergence would report one number and then reject a re-create naming exactly that number as
QueueNameExists— rejecting a request matching what the caller had just read back.They now share a named constant,
sqsDefaultMaximumMessageSize, so divergence is structurally impossible rather than merely tested. The test covers it either way.SendMessageenforcement is still absentNo length check exists against the attribute or any constant, so an oversized body is accepted. Per the issue's own acceptance criteria this PR documents that absence rather than adding a limit: enforcement is a new error path with its own scope, and adding it alongside a default change would conflate two observable behaviours. Tracked separately.
Tests
TestSQS_CreateQueue_MaximumMessageSizeDefault, under both the query and JSON protocols:1048576, asserted as an exact value rather than mere presence (pins it against future drift, per the acceptance criteria);262144is still reported back unchanged;GetQueueAttributesjust reported stays idempotent.That third case is the gate on both sites moving together. Mutation-tested by reverting only the read-path site: it fails with
QueueNameExists, exactly the failure mode the coupling exists to prevent.Verification
gofmt,go build,go vet,golangci-lint run ./...(0 issues),make test(race),test/e2e,make docs-reference-check docs-versions— all clean.check-doc-versions.shcaught a pinned version number in my first docs draft; the wording now refers to the issue instead.