Skip to content

Sending undefined in initIndex() function is creates and index with "undefined" name #1428

Closed
@anshulsahni

Description

@anshulsahni

While initialising the index - means calling initIndex() if no argument is sent then it considers index name as "undefined" and sends the request to algolia platform with index name value defined as undefined. Of course, the index of that name wouldn't exist in most of the systems, hence it creates a new index with the name undefined.

This is leading to two problems

  1. if the variable containing the index name is not having a value due to some bug, it's not possible to detect because initIndex() function is not throwing an error
  2. Unnecessarily, an index is created in the Algolia dashboard with an unwanted name, making it again very hard to detect or debug an issue

IMO initIndex() behaviour should be to raise an exception in case the value of the index name passed as an argument is undefined, null or an empty string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions