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

fix(recommend): remove the search user-agent from requests [RECO-2154] #1508

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raed667
Copy link
Contributor

@raed667 raed667 commented Feb 20, 2024

What

The createUserAgent function shouldn't set "Algolia for JavaScript" by default. Instead, this agent should be added in the build of the Search client.

Why

The Recommend client uses the same transporter utilities as the Search client, including the createUserAgent function. This causes it to set the Algolia for JavaScript user agent, which corresponds to Algolia Search.

The Recommend client shouldn't send Algolia Search user agents

How

Updated the function createUserAgent to accept an optional base UA as a second parameter. Recommend client can set that to an empty string, while the rest can still use the default value Algolia for JavaScript

@Haroenv
Copy link
Contributor

Haroenv commented Feb 20, 2024

If you look at #1507, I thought the conclusion was that "Algolia for JavaScript" isn't a search UA, but just a "JS client UA". Not sure this is needed

@raed667
Copy link
Contributor Author

raed667 commented Feb 20, 2024

Good catch @Haroenv i forgot about the Github issue 👀 i'll convert to draft for now and continue the discussion there.

@raed667 raed667 marked this pull request as draft February 20, 2024 14:42
@shortcuts
Copy link
Member

Same comments as in the issue for me too, the UA is the whole string being sent, Algolia for JavaScript is not scoped to the search client, the following segment defines the current client

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.

None yet

3 participants