Skip to content

Refused to set unsafe header "User-Agent" error when using Algolia Search widget  #689

@jamesnevada

Description

@jamesnevada

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

When running an Algolia search action (both On Change and On Submit) no results are returned and the console notes the error: Refused to set unsafe header "User-Agent" (once for On Submit, multiple errors for On Change - every keystroke)

I've attached screenshots below:

Screenshot 2023-03-28 at 1 58 44 PM

Screenshot 2023-03-29 at 4 40 55 PM

Expected Behavior

The Algolia search should show results from the index I created based on the search term I type in.

Algolia is fully set up and the Firebase extension is running correctly via changes made to documents. I've used the Search API key in Flutterflow.

Steps To Reproduce

  1. Create page

  2. Add text input field

  3. Add a list view or grid view

  4. Add a Card widget to the grid view with a text field

  5. Create a Local State variable (String) - I called it searchTerm

  6. Create an action chain on the text input field. (you can try both as On Submit and On Change -but search on Algolia via Text Input field not searchTerm when doing On Change)
    • Update Local State action for text submitted via Text Input Field
    • Algolia Search > scenes [Index] > searchTerm (or Text Input Field widget value if On Change)

  7. On the Grid View, create children from the Algolia search results

  8. Use a variable from the children for the text field in the Card widget

  9. Run and see if any results populate

Bug Report Code

IT4SjOflzItPj7xK7c/ubPlR/TssKVgnULg7mNV6EUojIojrP5lyXOjDYlttXdeFT2xYelv8sGMy+c3IueOXGOQHAw2aY65PwpZqWA3wIWeWM762Dc6KfmhSGcVMNEuV07Wo3B5/CNdfLlocw2D3HvDKfBLUNufSDGwWQsmjKoPPjVLhAi+6Xn0Jg1ZSfCvr

Context

Trying to populate search results from Algolia index instead of pulling in all documents from Firebase - I need to be able to access all the documents but it is expensive and slow pulling all the documents in and then filtering. Right now Algolia seems like the most effective option for that.

Additional info

I can provide more details if needed.

Environment

- FlutterFlow version: 3.1
- Platform: Web 
- Browser name and version: Chrome 111.0.5563.146
- Operating system and version affected: macOS Ventura 13.3 Beta

Metadata

Metadata

Labels

closed: not a bugThe behavior is correct/expected.status: can't reproduceFollowing the reported steps did not reproduce the bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions