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

feat(headless commerce): retrieve clientId from Relay instead of coveoua when building commerce API requests #4111

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

fbeaudoincoveo
Copy link
Contributor

@fbeaudoincoveo fbeaudoincoveo requested a review from a team as a code owner June 21, 2024 15:18
@fbeaudoincoveo fbeaudoincoveo requested review from olamothe, a team, fpbrault and louis-bompart and removed request for a team June 21, 2024 15:19
@developer-experience-bot
Copy link
Contributor

developer-experience-bot bot commented Jun 21, 2024

Pull Request Report

PR Title

❌ Title should follow the conventional commit spec:
<type>(optional scope): <description>

Example: feat(headless): add result-list controller

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 204.9 204.9 0
commerce 293.1 293.1 0
search 372.4 372.4 0
insight 352.4 352.4 0
product-listing 266.9 267 0
product-recommendation 170.8 170.8 0
recommendation 217.8 217.8 0
ssr 365.2 365.2 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
product-recommendation 0 10 0
product-listing 0 13 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : 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

@Spuffynism
Copy link
Contributor

Just noticed the query suggest request was forgotten:

export const buildQuerySuggestRequest = async (
id: string,
state: StateNeededByQuerySuggest
): Promise<QuerySuggestRequest> => {
const {view, user, ...restOfContext} = state.commerceContext;
return {
accessToken: state.configuration.accessToken,
url: state.configuration.platformUrl,
organizationId: state.configuration.organizationId,
trackingId: state.configuration.analytics.trackingId,
query: state.querySet[id],
...restOfContext,
clientId: await getVisitorID(state.configuration.analytics),

@fbeaudoincoveo
Copy link
Contributor Author

fbeaudoincoveo commented Jun 25, 2024

Just noticed the query suggest request was forgotten:

export const buildQuerySuggestRequest = async (
id: string,
state: StateNeededByQuerySuggest
): Promise<QuerySuggestRequest> => {
const {view, user, ...restOfContext} = state.commerceContext;
return {
accessToken: state.configuration.accessToken,
url: state.configuration.platformUrl,
organizationId: state.configuration.organizationId,
trackingId: state.configuration.analytics.trackingId,
query: state.querySet[id],
...restOfContext,
clientId: await getVisitorID(state.configuration.analytics),

Good catch @Spuffynism ! Fixing

Merged via the queue into master with commit 6c6b8e4 Jun 25, 2024
92 checks passed
@fbeaudoincoveo fbeaudoincoveo deleted the KIT-3335 branch June 25, 2024 17:36
github-merge-queue bot pushed a commit that referenced this pull request Jul 3, 2024
…4126)

https://coveord.atlassian.net/browse/KIT-3351

We now instead rely on the default browser navigator context provider to
retrieve the client ID from Relay in a client-side rendering scenario.

In a server-side rendering scenario, the implementer would be
responsible for retrieving the client ID from the request headers (or
generating one), returning this value in their navigator context
provider function, as well as in the response headers.

This reverts most of the changes I made in
#4111.

I also applied the same logic to the search engine, which reverts many
of the changes made by @louis-bompart in
#3820. These changes were made in a
separate commit, however, so we can easily revert them and keep the
scope to headless/commerce if we prefer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants