Closed shethj closed 1 month ago
Should we modify the config files in template-retail-react-app and the generator to remove the OCAPI proxy? I think our test mocks set up an OCAPI proxy mock that we'll need to clean up too.
Should we modify the config files in template-retail-react-app and the generator to remove the OCAPI proxy? I think our test mocks set up an OCAPI proxy mock that we'll need to clean up too.
Is this the only url/api that uses ocapi?
Should we modify the config files in template-retail-react-app and the generator to remove the OCAPI proxy? I think our test mocks set up an OCAPI proxy mock that we'll need to clean up too.
Is this the only url/api that uses ocapi?
Yes. It was the only OCAPI call we were making.
@vcua-mobify @unandyala Great callouts about OCAPI proxy. I tried removing the proxy and ran tests on the deployed store. Looks good to me.
One more spot we might want to clean up: https://github.com/SalesforceCommerceCloud/pwa-kit/blob/feature/server-affinity-cleanup/packages/pwa-kit-react-sdk/setup-jest.js#L35
This might be a separate clean up ticket but the generator prompts is for an instanceUrl
that, according to a comment in the generator, is only used to set up the OCAPI proxy: https://github.com/SalesforceCommerceCloud/pwa-kit/blob/feature/server-affinity-cleanup/packages/pwa-kit-create-app/scripts/create-mobify-app.js#L801
This might be a separate clean up ticket but the generator prompts is for an
instanceUrl
that, according to a comment in the generator, is only used to set up the OCAPI proxy: https://github.com/SalesforceCommerceCloud/pwa-kit/blob/feature/server-affinity-cleanup/packages/pwa-kit-create-app/scripts/create-mobify-app.js#L801
Yeah. I'm leaving all generator changes out of this PR. I'll have a follow up ticket for that since it involves testing and changes to tests as well. It'll blow up the scope of this one.
Description
For a Phased Launch storefront, SCAPI requires each request to contain ECOM dwsid in sfdc_dwsid header with each request. To allow PWA Kit to read dwsid from cookies we require the cookie to be set with httpOnly=false. Plugin SLAS manually sets response cookies and has been setting dwsid with httpOnly=false We can leverage that cookie to be used in PWA Kit to send with each SCAPI request.
Types of Changes
Changes
How to Test-Drive This PR
Local test run results:
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization