feat(redis): show key types in browser list

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-30 00:08:43 +08:00
1 parent 62aeae5de4
commit 62130938cf
2 files changed
+3 -3

No files matched your search

@@ -560,11 +560,11 @@ describe("RedisKeyBrowser scope changes", () => {
const browser = mountScopedBrowser(); const browser = mountScopedBrowser();
await settle(); await settle();
expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 0, 0, "*", 100, 8, false); expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 0, 0, "*", 100, 8, true);
await browser.setScope("connection", 1); await browser.setScope("connection", 1);
expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 1, 0, "*", 100, 8, false); expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 1, 0, "*", 100, 8, true);
previousDatabase.resolve({ previousDatabase.resolve({
cursor: 0, cursor: 0,
keys: [{ key_display: "db0-key", key_raw: "ZGIwLWtleQ==", key_type: "string", ttl: -1 }], keys: [{ key_display: "db0-key", key_raw: "ZGIwLWtleQ==", key_type: "string", ttl: -1 }],
@@ -418,7 +418,7 @@ async function fetchScanPage(requestId = searchRequestId): Promise<RedisScanResu
return { cursor, keys: [], total_keys: totalKeys }; return { cursor, keys: [], total_keys: totalKeys };
} }
const iterations = Math.min(iterationsPerCall, maxIterations - completedIterations); const iterations = Math.min(iterationsPerCall, maxIterations - completedIterations);
const result = await api.redisScanKeysBatch(props.connectionId, props.db, cursor, effectivePattern.value, pageSize, iterations, false); const result = await api.redisScanKeysBatch(props.connectionId, props.db, cursor, effectivePattern.value, pageSize, iterations, true);
if (totalKeys === 0) totalKeys = result.total_keys; if (totalKeys === 0) totalKeys = result.total_keys;
if (result.keys.length > 0 || result.cursor === 0) { if (result.keys.length > 0 || result.cursor === 0) {
return { ...result, total_keys: totalKeys }; return { ...result, total_keys: totalKeys };