Skip to content

fix(storage): use plain response body in case of XML deserialization error - #1245

Merged
dominique-pfister merged 2 commits into
mainfrom
xml-deserialization
Jul 28, 2026
Merged

fix(storage): use plain response body in case of XML deserialization error#1245
dominique-pfister merged 2 commits into
mainfrom
xml-deserialization

Conversation

@dominique-pfister

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +573 to +576
nock(`https://helix-code-bus.${CLOUDFLARE_ACCOUNT_ID}.r2.cloudflarestorage.com`)
.delete('/foo?x-id=DeleteObject')
.times(3)
.reply(expected.status, expected.message);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

return a plain error message, no XML

@github-actions

Copy link
Copy Markdown

This PR will trigger a patch release when merged.

this._r2 = new S3Client({
...baseOpts,
endpoint: `https://${r2AccountId}.r2.cloudflarestorage.com`,
region: 'us-east-1', // https://github.com/aws/aws-sdk-js-v3/issues/1845#issuecomment-754832210

@dominique-pfister dominique-pfister Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

us-east-1 takes precedence over baseOpts.region

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.

why?

r2SecretAccessKey: CLOUDFLARE_R2_SECRET_ACCESS_KEY,
bucketMap: parseBucketNames(),
disableExpectContinueHeader: true,
maxAttempts: 1,

@dominique-pfister dominique-pfister Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fail once in tests, then abort

Comment thread packages/helix-shared-storage/src/storage.js

@tripodsan tripodsan 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.

I do not agree with the order of the base opts

Comment thread packages/helix-shared-storage/src/storage.js
this._r2 = new S3Client({
...baseOpts,
endpoint: `https://${r2AccountId}.r2.cloudflarestorage.com`,
region: 'us-east-1', // https://github.com/aws/aws-sdk-js-v3/issues/1845#issuecomment-754832210

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.

why?

Comment thread packages/helix-shared-storage/src/storage.js
@dominique-pfister
dominique-pfister merged commit d7e90b7 into main Jul 28, 2026
6 checks passed
@dominique-pfister
dominique-pfister deleted the xml-deserialization branch July 28, 2026 07:54
adobe-bot pushed a commit that referenced this pull request Jul 28, 2026
# [@adobe/helix-shared-storage-v2.1.5](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-storage-v2.1.4...@adobe/helix-shared-storage-v2.1.5) (2026-07-28)

### Bug Fixes

* **storage:** use plain response body in case of XML deserialization error ([#1245](#1245)) ([d7e90b7](d7e90b7))
@adobe-bot

Copy link
Copy Markdown

🎉 This PR is included in version @adobe/helix-shared-storage-v2.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants