Repository navigation
Conversation
JSON.stringify leaves U+FFFE and U+FFFF raw, and SQS rejects any message containing them with InvalidMessageContents. A webhook payload carrying one of them was never queued: the receive handler answered 500 and every provider retry failed the same way. QueuerUtil.send, QueuerUtil.batchSend and Worker.send now encode bodies with toSqsMessageBody, which escapes characters outside the SQS allowed set as \uXXXX. They can only appear inside JSON strings, so the JSON stays valid and JSON.parse returns the original message exactly. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
✅ Deploy Preview for friggframework-org canceled.
|
|
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.




Summary
SQS rejects a message whose body contains a character outside its allowed set (
#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]) withInvalidMessageContents.JSON.stringifyescapes control characters and lone surrogates, but leaves U+FFFE and U+FFFF raw. A webhook payload carrying one of them was never queued:queueWebhookthrew, the receive handler answered 500, and every provider retry failed the same way, so the event was lost.Seen in production on one integration's webhook receiver:
Invalid binary character '#xFFFE' was found in the message bodyfromQueuerUtil.send.What changes
queues/sqs-message-body.js→toSqsMessageBody(message):JSON.stringify, then escape every character outside the SQS allowed set as\uXXXX. Those characters can only occur inside JSON string literals (the JSON structure is ASCII), so the result is still valid JSON andJSON.parsereturns the original message exactly: lossless, no replacement characters.QueuerUtil.send,QueuerUtil.batchSendandWorker.send, the three places core writes a JSON body to SQS. A body with no such characters is byte-identical to before.Tests
next:QueuerUtil.send/batchSendwith U+FFFE, U+FFFF (also in a key), a lone surrogate, an emoji, tab and newline. Each asserts the capturedSendMessagebody has no SQS-disallowed character and parses back to the original.Worker.send.packages/core: 205 suites, 2750 tests pass (2 skipped, as before).Not changed
Messages written to SQS outside core (adopter code calling the SDK directly) are not covered.
📦 Published PR as canary version:
2.0.0--canary.737.83b4e17.0✨ Test out this PR locally via:
npm install @friggframework/admin-scripts@2.0.0--canary.737.83b4e17.0 npm install @friggframework/core@2.0.0--canary.737.83b4e17.0 npm install @friggframework/devtools@2.0.0--canary.737.83b4e17.0 npm install @friggframework/eslint-config@2.0.0--canary.737.83b4e17.0 npm install @friggframework/prettier-config@2.0.0--canary.737.83b4e17.0 npm install @friggframework/schemas@2.0.0--canary.737.83b4e17.0 npm install @friggframework/serverless-plugin@2.0.0--canary.737.83b4e17.0 npm install @friggframework/test@2.0.0--canary.737.83b4e17.0 npm install @friggframework/ui@2.0.0--canary.737.83b4e17.0 # or yarn add @friggframework/admin-scripts@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/core@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/devtools@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/eslint-config@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/prettier-config@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/schemas@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/serverless-plugin@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/test@2.0.0--canary.737.83b4e17.0 yarn add @friggframework/ui@2.0.0--canary.737.83b4e17.0