revert(aso-overlay): rollback #2822 to fix dev 500 (response.headers.raw is not a function)#2838
Closed
abhishekgarg18 wants to merge 1 commit into
Closed
revert(aso-overlay): rollback #2822 to fix dev 500 (response.headers.raw is not a function)#2838abhishekgarg18 wants to merge 1 commit into
abhishekgarg18 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
6 tasks
Member
Author
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
Reverts #2822 (`feat(aso-overlay): CloudWatch EMF instrumentation for READ path`) to restore the dev overlay endpoint. Since #2822 deployed to dev (2026-07-16T03:52Z), every GET /config/dev/*/redirects.txt returns HTTP 500 with:
```
x-error: response.headers.raw is not a function
```
Verified reproduction on dev with a valid ASO_OVERLAY_API_KEY, on multiple tenants:
Consistent, non-intermittent, on both the 200 and 304 conditional-GET code paths.
Timeline
Nothing else in the overlay hot path changed in this window. Other PRs merged after this window (#2820, #2833, #2804, #2823) don't touch redirects.js, aso-overlay-key-handler.js, or the metrics-emf infrastructure.
Root cause (in progress)
The error `response.headers.raw is not a function` is thrown at `@adobe/helix-universal/aws-adapter.js:254`:
```js
...splitHeaders(response.headers.raw(), con.log),
```
That helper expects `@adobe/fetch`-style Headers (which have `.raw()`). The Response returned to aws-adapter has a native Web-Fetch-API Headers instance (no `.raw()`).
Local repro confirms `createResponse` from `@adobe/spacecat-shared-http-utils` correctly returns `@adobe/fetch` Response with `.raw()` working (see snippet below). So the failure is Lambda-bundle-specific — likely an esbuild resolution/tree-shaking interaction introduced by #2822's new imports (`aso-overlay-metrics.js` constants + widened use of `metrics-emf.js`).
```js
// Local test (from within the repo)
import { createResponse } from '@adobe/spacecat-shared-http-utils';
const r = createResponse('body', 200, { 'content-type': 'text/plain' });
console.log(typeof r.headers.raw === 'function'); // true — works locally
```
Not fully root-caused yet. Reverting to unblock dev while investigation continues. This is the safest immediate fix — every branch of the overlay endpoint is failing, and the metrics that #2822 added are non-critical (dashboards can wait a day).
Follow-up plan (post-revert)
Impact if not reverted
Test plan
🤖 Generated with Claude Code