Skip to content

RI-8318 Refresh key indexes on key details refresh#6208

Open
dantovska wants to merge 1 commit into
mainfrom
fe/feature/RI-8318/refresh-key-indexes-on-refresh
Open

RI-8318 Refresh key indexes on key details refresh#6208
dantovska wants to merge 1 commit into
mainfrom
fe/feature/RI-8318/refresh-key-indexes-on-refresh

Conversation

@dantovska

@dantovska dantovska commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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 useIsKeyIndexed already 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

  • Unit: new case in KeyDetailsHeader.spec.tsx — clicking the key refresh button calls the key-indexes refresh; existing header and useIsKeyIndexed suites pass.
  • Manual: select a Hash/JSON key showing "Make searchable", create a covering index from the Search page, hit the refresh button on the key details — the button switches to "View index" without reselecting the key (and vice versa after FT.DROPINDEX).

Closes #RI-8318

🤖 Generated with Claude Code

@dantovska dantovska requested a review from a team as a code owner July 14, 2026 13:34
@dantovska dantovska self-assigned this Jul 14, 2026
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>
@dantovska dantovska force-pushed the fe/feature/RI-8318/refresh-key-indexes-on-refresh branch from 39a1d67 to 491f4e2 Compare July 14, 2026 15:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@dantovska dantovska force-pushed the fe/feature/RI-8318/refresh-key-indexes-on-refresh branch from 3f5cfb5 to 491f4e2 Compare July 14, 2026 15:55
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.07% 27732/33385
🟡 Branches 68.85% 11841/17198
🟡 Functions 78.02% 7381/9461
🟢 Lines 83.53% 27006/32330

Test suite run success

7834 tests passing in 865 suites.

Report generated by 🧪jest coverage report action from 491f4e2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant