Browse Source

fix(nocodb): only set none list for FILTER_EXP, SORT, and MODEL_ROLE_VISIBILITY

pull/5430/head
Wing-Kam Wong 2 years ago
parent
commit
b424f22dda
  1. 11
      packages/nocodb/src/lib/cache/RedisCacheMgr.ts
  2. 11
      packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts

11
packages/nocodb/src/lib/cache/RedisCacheMgr.ts vendored

@ -158,7 +158,16 @@ export default class RedisCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list` ? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`; : `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
if (!list.length) { if (!list.length) {
return this.set(listKey, ['NONE']); if (
[
CacheScope.FILTER_EXP,
CacheScope.SORT,
CacheScope.MODEL_ROLE_VISIBILITY,
].includes(scope as CacheScope)
) {
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
} }
// fetch existing list // fetch existing list
const listOfGetKeys = const listOfGetKeys =

11
packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts vendored

@ -158,7 +158,16 @@ export default class RedisMockCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list` ? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`; : `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
if (!list.length) { if (!list.length) {
return this.set(listKey, ['NONE']); if (
[
CacheScope.FILTER_EXP,
CacheScope.SORT,
CacheScope.MODEL_ROLE_VISIBILITY,
].includes(scope as CacheScope)
) {
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
} }
// fetch existing list // fetch existing list
const listOfGetKeys = const listOfGetKeys =

Loading…
Cancel
Save