Skip to content

fix(sqs): MaximumMessageSize default is 1 MiB, not 256 KiB (#439) - #450

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/439-sqs-max-message-size
Aug 1, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/439-sqs-max-message-size

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #439.

The defect

GetQueueAttributes reported 262144 (256 KiB) as MaximumMessageSize for 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:

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.

SendMessage enforcement is still absent

No 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:

  • a bare queue reports 1048576, asserted as an exact value rather than mere presence (pins it against future drift, per the acceptance criteria);
  • an explicit 262144 is still reported back unchanged;
  • re-creating with the value GetQueueAttributes just 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.sh caught a pinned version number in my first docs draft; the wording now refers to the issue instead.

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
scttfrdmn force-pushed the feat/439-sqs-max-message-size branch from 78520ad to 60b43b4 Compare August 1, 2026 18:10
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 020dffd into main Aug 1, 2026
16 checks passed
@scttfrdmn
scttfrdmn deleted the feat/439-sqs-max-message-size branch August 2, 2026 22:01
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.

SQS: MaximumMessageSize default is 256 KiB, AWS documents 1 MiB

1 participant