From 957f04e1fd6f1b271aff4d77560d874ce1afd850 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 31 May 2023 13:24:28 +0800 Subject: [PATCH] fix(nocodb): use includes to check if NONE is in target list --- packages/nocodb/src/cache/RedisCacheMgr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/cache/RedisCacheMgr.ts b/packages/nocodb/src/cache/RedisCacheMgr.ts index e0dafae4a1..7fc39c554d 100644 --- a/packages/nocodb/src/cache/RedisCacheMgr.ts +++ b/packages/nocodb/src/cache/RedisCacheMgr.ts @@ -135,7 +135,7 @@ export default class RedisCacheMgr extends CacheMgr { // e.g. arr = ["nc:::", "nc:::"] const arr = (await this.get(key, CacheGetType.TYPE_ARRAY)) || []; log(`RedisCacheMgr::getList: getting list with key ${key}`); - const isNoneList = arr.length && arr[0] === 'NONE'; + const isNoneList = arr.length && arr.includes('NONE'); if (isNoneList) { return Promise.resolve({ @@ -248,7 +248,7 @@ export default class RedisCacheMgr extends CacheMgr { : `${this.prefix}:${scope}:${subListKeys.join(':')}:list`; log(`RedisCacheMgr::appendToList: append key ${key} to ${listKey}`); let list = (await this.get(listKey, CacheGetType.TYPE_ARRAY)) || []; - if (list.length && list[0] === 'NONE') { + if (list.length && list.includes('NONE')) { list = []; await this.del(listKey); }