Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeFetcher response does not match actual retuned data #2034

Open
FransEngstrom opened this issue Feb 6, 2025 · 1 comment
Open

NativeFetcher response does not match actual retuned data #2034

FransEngstrom opened this issue Feb 6, 2025 · 1 comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug

Comments

@FransEngstrom
Copy link

Describe the Bug

The fetch method on the NativeFetcher class does not return the claimed response object:

NativeDataFetcherResponse<T> { status: number statusText: string data: T headers?: HeadersInit }
Instead it returns something like this where the request data is nested under Symbols:
{ data: { sitecore: { context: [Object], route: [Object] } }, [Symbol(state)]: { aborted: false, rangeRequested: false, timingAllowPassed: true, requestIncludesCredentials: true, type: 'default', status: 200, timingInfo: { startTime: 22155.710625, redirectStartTime: 0, redirectEndTime: 0, postRedirectStartTime: 22155.710625, finalServiceWorkerStartTime: 0, finalNetworkResponseStartTime: 22237.364583, finalNetworkRequestStartTime: 22155.976292, endTime: 0, encodedBodySize: 14558, decodedBodySize: 72786, finalConnectionTimingInfo: [Object] }, cacheState: '', statusText: 'OK', headersList: HeadersList { cookies: [Array], [Symbol(headers map)]: [Map], [Symbol(headers map sorted)]: [Array] }, urlList: [ URL {} ], body: { stream: [ReadableStream], source: null, length: null } }, [Symbol(headers)]: Headers {} }

To Reproduce

Do a request with the fetch method on the Native fetch class, look at the response.

Expected Behavior

It should return the data the interface says it will.

Possible Fix

No response

Provide environment information

  • Sitecore Version: 10.4x
  • JSS Version: 22.4.1
  • Browser Name and version: Happens serverside.
  • Operating System and version (desktop or mobile):
  • Link to your project (if available):
@yavorsk
Copy link
Contributor

yavorsk commented Feb 11, 2025

Hi @FransEngstrom , we have a work item about this and we'll work on it soon.
Thanks for the submission!

@yavorsk yavorsk added the backlog Issue/PR/discussion is reviewed and added to backlog for the further work label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug
Projects
None yet
Development

No branches or pull requests

2 participants