Open
Conversation
- simple standalone hook to get infro from the index via the API - no redux, local state re #RI-7930
re #RI-7930
Contributor
Code Coverage - Frontend unit tests
Test suite run success5570 tests passing in 709 suites. Report generated by 🧪jest coverage report action from b53b38a |
redisinsight/ui/src/pages/vector-search/hooks/useIndexInfo/useIndexInfo.ts
Show resolved
Hide resolved
redisinsight/ui/src/pages/vector-search/hooks/useIndexInfo/useIndexInfo.ts
Show resolved
Hide resolved
redisinsight/ui/src/mocks/factories/vector-search/indexInfoApi.factory.ts
Outdated
Show resolved
Hide resolved
- Updated the useIndexInfo hook to track fetch requests and prevent stale data from being set - Added a test to verify that stale responses are ignored when indexName changes quickly re #RI-7930
… hook - Updated the useIndexInfo hook to reset indexInfo and error states when indexName is empty. - Implemented a test to verify that the state resets correctly when indexName changes to an empty string. re #RI-7930
- Changed the index type to uppercase in the indexInfo factory. - Removed the obsolete indexInfoApi factory and updated tests to use the new indexInfo factory. - Adjusted tests in useIndexInfo.spec.ts and useIndexInfo.utils.spec.ts to reflect the changes in factory usage. re #RI-7930
redisinsight/ui/src/pages/vector-search/hooks/useIndexInfo/useIndexInfo.ts
Show resolved
Hide resolved
redisinsight/ui/src/pages/vector-search/hooks/useIndexInfo/useIndexInfo.utils.ts
Show resolved
Hide resolved
- Updated the useIndexInfo hook to prevent getting stuck in loading state when indexName changes to an empty string during an ongoing fetch. - Enhanced the corresponding test to verify that loading state resets correctly without remaining stuck. re #RI-7930
- Changed the type of the `type` property in the IndexAttribute interface from string to FieldTypes for better type safety. - Updated the normalizeFieldType function to return FieldTypes instead of string, ensuring consistent type usage across the codebase. re #RI-7930
dantovska
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Added a hook to get index information
PS: Later to be used together with the
IndexInfocomponent on the new Vector Search page (#5436)Testing
Note
Medium Risk
Introduces new async fetching + transformation logic used by the Vector Search UI; main risk is incorrect/stale state or type normalization causing wrong index info to render.
Overview
Adds a new
useIndexInfohook for the Vector Search page to fetchREDISEARCH_INFOviaapiService, store results in local state, and expose{ indexInfo, loading, error, refetch }.Includes DTO→frontend model transformation (
snake_case→camelCase, numeric string→number, field type normalization) and guards against races by ignoring stale responses and resettingloading/errorwhenindexNamebecomes empty.Updates the
IndexInfomock factory to emit uppercase attributetypevalues (matching API expectations) and adds unit tests covering successful fetch, error handling, refetch, stale-response handling, and the transform utilities.Written by Cursor Bugbot for commit b53b38a. This will update automatically on new commits. Configure here.