scout-extended icon indicating copy to clipboard operation
scout-extended copied to clipboard

EngineManager doesn't honor scout.identify configuration

Open renanbr opened this issue 1 year ago • 3 comments

  • Laravel version: 9.48.0
  • Algolia Scout Extended version: 2.1.0
  • Algolia Client Version: 3.3.2
  • Language Version: 8.1.20

Description

Algolia analytics dashboard doesn't recognise user searches because the application doesn't send the X-Algolia-UserToken header when performing searches even when configuring SCOUT_IDENTIFY env var to true.

Steps To Reproduce

  • Make sure scout.identify configuration is true
  • Perform some searches with an authenticated user
  • Check latest requests headers in Algolia dashboard

renanbr avatar Jul 06 '23 12:07 renanbr

I've just run into this issue too. Relevant code is in vendor/laravel/scout/src/EngineManager.php defaultAlgoliaHeaders() method but it never gets executed.

Scout docs https://laravel.com/docs/10.x/scout#identifying-users

Shkeats avatar Dec 04 '23 11:12 Shkeats

Does anyone know a workaround for the issue?

szhorvath avatar Feb 08 '24 14:02 szhorvath

Does anyone know a workaround for the issue?

We override the EngineManager with a housemade class overriding the createAlgoliaDriver() method.

This approach made us able to fix scout.algolia.*_timeout configuration as well.

renanbr avatar Feb 15 '24 12:02 renanbr