-
Notifications
You must be signed in to change notification settings - Fork 34
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
fix(commerce): populate context.user.userAgent
with navigatorContext
#4113
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support product-recommendation : missing SSR support product-listing : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts
Show resolved
Hide resolved
If we use the navigator context provider to set the |
packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts
Show resolved
Hide resolved
…populate-user-agent
…opulate-user-agent
Re-requesting reviews since I've changed the approach to use the navigator context across commerce requests to fetch the user agent and referrer! |
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.
✅
.../commerce/facets/facet-search-set/category/commerce-category-facet-search-request-builder.ts
Show resolved
Hide resolved
context.user.userAgent
with relaycontext.user.userAgent
with navigatorContext
…ui-kit into fix-capi-1091-populate-user-agent
headless was populating the
context.user.userAgent
property with what was set through thesetUser
. With this PR, we extract theuserAgent
and thereferrer
from the relay instance and use these values instead. This makes using the headless commerce controllers less error-prone.setUser
action (and its sibling method on the context controller), andsetView
'sreferrer
parameter, which I do in this PR. Do you think this makes sense? Is there a use case for allowing manual control over these parameters? @samisayegh @louis-bompart @fbeaudoincoveo ?CAPI-1091