Skip to content

[Bug]: Database list search not working for not connected databases, database still visible after search #4927

@Matiszak

Description

@Matiszak

Preconditions (Any important steps we need to know)

Have a database which is in "NOT CONNECTED" state (e.g. I'm importing it from a file)

Steps to reproduce (How to reproduce what you found step by step)

  1. Import database from a file
  2. On main page in "Database List Search" search for a string that should show not show database above (e.g. database with name "redis_abc" and put in searchbox "test")

Actual behavior (A short description of what you found)

Database is still visible on the databases list

Expected behavior (A short description of what you expected to find)

Database is not visible on the databases list

Screenshots (Paste or drag-and-drop a screenshot or a link to a recording)

Image

Additional context (Operating system, version of Redis Insight, Redis database version, Redis module version, database type, connection type, logs, or any other information)

From my debugging it's caused by this line:

(item.connectionType &&
CONNECTION_TYPE_DISPLAY[item.connectionType]
?.toLowerCase()
?.indexOf(value) !== -1) ||

During my debugging variables were:

item.connectionType = "NOT CONNECTED"
CONNECTION_TYPE_DISPLAY = {
    "STANDALONE": "Standalone",
    "CLUSTER": "OSS Cluster",
    "SENTINEL": "Sentinel"
}

This causes
CONNECTION_TYPE_DISPLAY[item.connectionType] evaluation to undefined
And overall

item.connectionType &&
              CONNECTION_TYPE_DISPLAY[item.connectionType]
                ?.toLowerCase()
                ?.indexOf(value) !== -1

to be true

Which causes database to be shown on the list despite fact that it does not contain any value containing searched 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