feat(redis): show key types in browser list

This commit is contained in:
二丫讲梵 2026-07-30 00:08:43 +08:00 committed by GitHub
parent 62aeae5de4
commit 62130938cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -560,11 +560,11 @@ describe("RedisKeyBrowser scope changes", () => {
const browser = mountScopedBrowser();
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);
expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 1, 0, "*", 100, 8, false);
expect(mocks.redisScanKeysBatch).toHaveBeenCalledWith("connection", 1, 0, "*", 100, 8, true);
previousDatabase.resolve({
cursor: 0,
keys: [{ key_display: "db0-key", key_raw: "ZGIwLWtleQ==", key_type: "string", ttl: -1 }],

View File

@ -418,7 +418,7 @@ async function fetchScanPage(requestId = searchRequestId): Promise<RedisScanResu
return { cursor, keys: [], total_keys: totalKeys };
}
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 (result.keys.length > 0 || result.cursor === 0) {
return { ...result, total_keys: totalKeys };