Skip to content

Commit cb42874

Browse files
committed
fix: key deletion operation was incomplete (#348)
1 parent aa3383d commit cb42874

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

frontend/src/objects/redisServerState.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ export class RedisServerState {
296296
removeKeyNode(key, isLayer) {
297297
if (isLayer === true) {
298298
this.deleteChildrenKeyNodes(key)
299+
} else {
300+
const nodeKey = `${ConnectionType.RedisValue}/${key}`
301+
this.nodeMap.delete(nodeKey)
299302
}
300303

301304
const dbRoot = this.getRoot()

frontend/src/stores/browser.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,17 +708,19 @@ const useBrowserStore = defineStore('browser', {
708708
}
709709
let match = prefix
710710
const separator = this.getSeparator(server)
711-
if (!endsWith(match, separator)) {
712-
match += separator + '*'
713-
} else {
714-
match += '*'
711+
if (!isEmpty(match)) {
712+
if (!endsWith(match, separator)) {
713+
match += separator + '*'
714+
} else {
715+
match += '*'
716+
}
715717
}
716718
// FIXME: ignore original match pattern due to redis not support combination matching
717719
const { match: originMatch, type: keyType, exact } = this.getKeyFilter(server)
718720
const { keys, maxKeys, success } = await this._loadKeys({
719721
server,
720722
db,
721-
match: originMatch,
723+
match: match || originMatch,
722724
exact: false,
723725
matchType: keyType,
724726
all: true,

0 commit comments

Comments
 (0)