Skip to content

Preserve split UTF-8 request bodies in generated serializers - #2808

Open
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-azure-azurite-issue-2670
Open

Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-azure-azurite-issue-2670

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Generated Blob, Queue, and Table serializers decoded request chunks independently before joining them, corrupting multi-byte UTF-8 characters split across stream boundaries.

  • Serializer decoding
    • Collect request body chunks as Buffers.
    • Normalize string-emitted chunks with explicit UTF-8 encoding.
    • Decode only once after Buffer.concat(...).
segments.push(
  typeof buffer === "string"
    ? Buffer.from(buffer, "utf8")
    : Buffer.from(buffer)
);

resolve(Buffer.concat(segments).toString("utf8"));
  • Regression coverage

    • Added shared generated-serializer tests for Blob, Queue, and Table.
    • Forces a multi-byte character to split across chunks and verifies deserialized JSON body text is preserved.
  • Release notes

    • Added an Upcoming Release changelog entry for the request body decoding fix.
Original prompt

Fix Azure/Azurite issue #2670. The generated Blob, Queue, and Table readRequestIntoText helpers currently collect incoming Buffer chunks as strings and join them, which corrupts a multi-byte UTF-8 character split across chunk boundaries. Collect Buffer chunks, use Buffer.concat, then decode once as UTF-8 in all three serializers. Add focused regression tests that force a multi-byte character to split across chunks for Blob, Queue, and Table. Add an Upcoming Release ChangeLog entry. Run targeted tests, npm run build, npm run lint, formatting, and diff checks. Keep the change surgical. The locally validated version changed ChangeLog.md, src/{blob,queue,table}/generated/utils/serializer.ts, and tests/common/generatedSerializer.test.ts. Include 'Fixes #2670' in the PR body.

Copilot AI lite review requested due to automatic review settings September 24, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Required build, lint, formatting, and targeted test validation remains unverified.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: None

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
@jainakanksha-msft Akanksha Jain (jainakanksha-msft) changed the title [WIP] Fix readRequestIntoText helpers for multi-byte UTF-8 characters Preserve split UTF-8 request characters Sep 24, 2026
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) marked this pull request as ready for review September 24, 2026 08:45
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Final tests, lint, and build validation remain unverified.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: None

Copilot AI review requested due to automatic review settings September 24, 2026 08:46
Copilot AI changed the title Preserve split UTF-8 request characters Preserve split UTF-8 request bodies in generated serializers Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified, and the focused fixes, regression tests, and changelog update are included.

Review effort: Lite
Findings: None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table service corrupts multi-byte UTF-8 characters split across request body chunks (readRequestIntoText uses segments.join instead of Buffer.concat)

3 participants