-
Notifications
You must be signed in to change notification settings - Fork 12
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(javascript): do not send user-agent for Predict #919
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
if (algoliaAgent.value) { | ||
queryParameters['x-algolia-agent'] = algoliaAgent.value; | ||
} | ||
|
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.
This is the only part that impacts the other client, which is something we are in control of as it's only reached by the factory of each clients.
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, do we know when the Predict client will accept user-agent ?
their engineers are OOO so the issue should be tackled once they come back |
This reverts commit dc43c2a.
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-621
See https://algolia.atlassian.net/browse/PRED-523 for context
Changes included:
The Predict API does not yet support user-agent query parameters, which makes every requests being rejected for unknown/non-parsable query parameter.
This is a not-really-pretty patch until it gets implemented, I've tried to minimize the footprint on the other clients but they all use the same requester. LMK if you have alternatives.
I've added the Jira ticket in a comment near the patches until it gets resolved, to avoid forgetting to remove it.
The fix is only applied for JavaScript, as it's the only client that is recommended from the Predict team.
🧪 Test
yarn docker playground javascript predict
should show an emptyalgoliaAgent
, which gets removed if you do a real request (screenshot is with theechoRequester
)