-
Notifications
You must be signed in to change notification settings - Fork 143
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
@W-17039090@ : [Server Affinity] - Attach dwsid to SCAPI request headers #2090
Conversation
@@ -57,7 +57,6 @@ const AppConfig = ({children, locals = {}}) => { | |||
redirectURI={`${appOrigin}/callback`} | |||
proxy={`${appOrigin}${commerceApiConfig.proxyPath}`} | |||
headers={headers} | |||
OCAPISessionsURL={`${appOrigin}${proxyBasePath}/ocapi/s/${locals.site?.id}/dw/shop/v22_8/sessions`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good that we're removing the OCAPI sessions URL from the generated apps since we've removed it from template-retail-react-app already.
Should we modify the config files in template-retail-react-app and the generator to remove the OCAPI proxy? |
Is this the only url/api that uses ocapi? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Jainam Sheth <[email protected]>
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 |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the changes! +1
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