pwa-kit
pwa-kit copied to clipboard
issue 738 - adding back OCAPI session bridge for phased rollouts
see issue #738
Description
Steps To Reproduce
- start out on pwa, add products to guest cart
- cart page redirects to SFRA cart page, session is successfully restored from PWA refresh token
- on SFRA login page, click "login" -> returns to PWA for login
- login via PWA
- return to SFRA cart page. notice that the previous guest
dwsid
is still set andonSession
is never triggered on SFRA, resulting in a cleared guest cart. Customer is not logged in via SFRA.
Expected result
Returning to SFRA after logging in via PWA should maintain session state and cart
Current State:
Notice that returning to SFRA the second time never calls onSession
so the dwsid
is never set from the logged in refresh token. The old dwsid
from the initial session is used, resulting in an empty cart. There's no way to login via SFRA.
https://user-images.githubusercontent.com/375787/192851283-ddea313f-ecfc-4451-b984-f3f862a460b1.mov
Updated State
https://user-images.githubusercontent.com/375787/192851325-e499d233-b54b-44e5-8e73-11e5d274d4c9.mov
Types of Changes
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Documentation update
- [ ] Breaking change (could cause existing functionality to not work as expected)
- [ ] Other changes (non-breaking changes that does not fit any of the above)
Changes
- restoring previous code/ session bridge that was removed #684, required for phased rollouts. Left session bridge commented out. If this is the desired approach, we should add this line to the phased rollout documentation
How to Test-Drive This PR
- start out on pwa, add products to guest cart
- cart page redirects to SFRA cart page, session is successfully restored from PWA refresh token
- on SFRA login page, click "login" -> returns to PWA for login
- login via PWA
- return to SFRA cart page. notice you are correctly logged in and cart is restored.
Checklists
General
- [ ] Changes are covered by test cases
- [ ] CHANGELOG.md updated with a short description of changes (not required for documentation updates)
Accessibility Compliance
You must check off all items in one of the follow two lists:
- [x] There are no changes to UI
or...
- [ ] Changes were tested with a Screen Reader (iOS VoiceOver or Android Talkback) and had no issues
- [ ] Changes comply with WCAG 2.0 guidelines levels A and AA
- [ ] Changes to common UI patterns and interactions comply with WAI-ARIA best practices
Localization
- [ ] Changes include a UI text update in the Retail React App (which requires translation)
@johnboxall @kevinxh I'd like to get your takes on this change.
To me, the changes proposed in this PR makes sense and it's easier to implement than other options. Since the PWA Kit itself does not have any use for the session bridge, it being commented out by default makes sense. Only users who are setting up a phased launch environment should uncomment it.
If we add this change, we'll want to update our phased launch documentation to include a step to uncomment and enable the session bridge.
I believe that once we merge this, we will no longer need to session bridge on the PWA side. cc @shethj
I'll come back to this PR after reviewing this.
We are currently on hold due to holiday moratorium for SLAS session bridge work like this.
@sandragolden With the SESB (Session Bridging) changes in https://github.com/SalesforceCommerceCloud/plugin_slas/releases/tag/v6.4.0 are we able to close this? cc @shethj @vcua-mobify thoughts?
@sandragolden With the SESB (Session Bridging) changes in https://github.com/SalesforceCommerceCloud/plugin_slas/releases/tag/v6.4.0 are we able to close this? cc @shethj @vcua-mobify thoughts?
Hi @bfeister, I upgraded to plugin_slas
v6.4.1 and can confirm this is still an issue with hybrid deployments. I verified the issue is present in pwa-kit v2.2.0 and v2.6.0. This fix still corrects the issue.
This change has been merged in #1164.