RI-8318 Refresh key indexes on key details refresh#6208
Conversation
The key-indexes lookup behind View index / Make searchable is cached per key, so refreshing the key details kept showing a stale state after indexes were created or dropped elsewhere. Force a re-fetch as part of the key refresh action. References: #RI-8318 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39a1d67 to
491f4e2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 491f4e2f1d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const handleRefreshKey = () => { | ||
| dispatch(refreshKey(keyBuffer!, type, undefined, length)) | ||
| refreshKeyIndexes() |
There was a problem hiding this comment.
Gate index refreshes on manual refreshes
When auto-refresh is enabled for Hash/JSON keys, AutoRefresh calls onRefresh(false) on each interval, but this handler ignores that argument and unconditionally invokes refreshKeyIndexes(). The hook dispatches fetchKeyIndexesAction(keyName, true), whose force path skips the existing loading guard, so a slow key-indexes request can be restarted every 5s and race with earlier responses. Please only force the index lookup for the manual refresh click or include the key-index loading state in the refresh gate.
Useful? React with 👍 / 👎.
3f5cfb5 to
491f4e2
Compare
Code Coverage - Frontend unit tests
Test suite run success7834 tests passing in 865 suites. Report generated by 🧪jest coverage report action from 491f4e2 |
What
The "View index" / "Make searchable" button in the key details header is driven by a key-indexes lookup that is cached per key, so refreshing the key details kept showing a stale state after an index was created or dropped elsewhere. The key refresh action now also forces a key-indexes re-fetch (via the force path
useIsKeyIndexedalready exposes), so the button reflects the current indexes.Before:
Screen.Recording.2026-07-14.at.18.58.38.mov
After:
Screen.Recording.2026-07-14.at.18.57.33.mov
Testing
KeyDetailsHeader.spec.tsx— clicking the key refresh button calls the key-indexes refresh; existing header anduseIsKeyIndexedsuites pass.FT.DROPINDEX).Closes #RI-8318
🤖 Generated with Claude Code