Skip to content

Commit 446bee5

Browse files
committed
Merge branch 'main' into fe/bugfix/RI-3725_Redisearch_light_module_not_loaded
2 parents 9b6f00d + d2fc109 commit 446bee5

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

redisinsight/api/test/api/database-analysis/POST-instance-id-analysis.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, describe, deps, before, getMainCheckFn } from '../deps';
1+
import { expect, describe, deps, before, getMainCheckFn, requirements } from '../deps';
22
import { analysisSchema } from './constants';
33
const { localDb, request, server, constants, rte } = deps;
44

@@ -12,6 +12,9 @@ const mainCheckFn = getMainCheckFn(endpoint);
1212
let repository;
1313

1414
describe('POST /instance/:instanceId/analysis', () => {
15+
// todo: skip for RE for now since scan 0 count 10000 might return cursor and 0 keys multiple times
16+
requirements('!rte.re');
17+
1518
before(async() => {
1619
repository = await localDb.getRepository(localDb.repositories.DATABASE_ANALYSIS);
1720

redisinsight/api/test/api/keys/POST-instance-id-keys.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ describe('POST /instance/:instanceId/keys', () => {
331331
},
332332
{
333333
name: 'Should search by with ? in the end (without keys info)',
334-
query: {
334+
data: {
335335
cursor: '0',
336336
match: `${constants.TEST_RUN_ID}_str_key_10?`,
337337
keysInfo: 'false',
@@ -922,7 +922,7 @@ describe('POST /instance/:instanceId/keys', () => {
922922
[
923923
{
924924
name: 'Should filter by type (string)',
925-
query: {
925+
data: {
926926
cursor: '0',
927927
type: 'string',
928928
count: 200,

redisinsight/api/test/api/ws/bulk-actions/bulk-actions-create.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('bulk-actions', function () {
3737
it('should not crash on 100 the same concurrent bulk-actions create events', async () => {
3838
let errors = 0;
3939
let created = 0;
40-
await Promise.all((new Array(100).fill(1)).map(() => new Promise((res, rej) => {
40+
await Promise.all((new Array(10).fill(1)).map(() => new Promise((res, rej) => {
4141
client.emit('create', createDto, (ack, err) => {
4242
if (ack.status === 'error') {
4343
errors += 1;
@@ -60,7 +60,7 @@ describe('bulk-actions', function () {
6060
client.on('exception', rej);
6161
})));
6262

63-
expect(errors).to.eq(99);
63+
expect(errors).to.eq(9);
6464
expect(created).to.eq(1);
6565
});
6666
});

redisinsight/api/test/api/ws/monitor/monitor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('monitor', function () {
2222
describe('Connection edge cases', () => {
2323
it('should not crash on 100 concurrent monitor connections to the same db', async () => {
2424
const client = await getMonitorClient(constants.TEST_INSTANCE_ID);
25-
await Promise.all((new Array(100).fill(1)).map(() => new Promise((res, rej) => {
25+
await Promise.all((new Array(10).fill(1)).map(() => new Promise((res, rej) => {
2626
client.emit('monitor', { logFileId: constants.getRandomString() }, (ack) => {
2727
expect(ack).to.eql({ status: 'ok' });
2828
res(ack);

redisinsight/api/test/api/ws/pub-sub/pub-sub.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('pub-sub', function () {
4545

4646
describe('Connection edge cases', () => {
4747
it('should not crash on 100 concurrent pub-sub connections to the same db', async () => {
48-
await Promise.all((new Array(100).fill(1)).map(() => new Promise((res, rej) => {
48+
await Promise.all((new Array(10).fill(1)).map(() => new Promise((res, rej) => {
4949
client.emit('subscribe', { subscriptions: [pSubscription, subscription] }, (ack) => {
5050
expect(ack).to.eql({ status: 'ok' });
5151
res(ack);

redisinsight/ui/src/pages/browser/components/key-list/KeyList.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ const KeyList = forwardRef((props: Props, ref) => {
7575
const { keyList: { scrollTopPosition } } = useSelector(appContextBrowser)
7676

7777
const [, rerender] = useState({})
78+
const [firstDataLoaded, setFirstDataLoaded] = useState(!!keysState.keys.length)
7879

7980
const itemsRef = useRef(keysState.keys)
81+
const isNotRendered = useRef(true)
8082
const renderedRowsIndexesRef = useRef({ startIndex: 0, lastIndex: 0 })
8183

8284
const dispatch = useDispatch()
@@ -99,6 +101,12 @@ const KeyList = forwardRef((props: Props, ref) => {
99101

100102
useEffect(() => {
101103
itemsRef.current = [...keysState.keys]
104+
105+
if (!isNotRendered.current && !loading) {
106+
setFirstDataLoaded(true)
107+
}
108+
109+
isNotRendered.current = false
102110
if (itemsRef.current.length === 0) {
103111
rerender({})
104112
return
@@ -135,6 +143,9 @@ const KeyList = forwardRef((props: Props, ref) => {
135143
}
136144

137145
const getNoItemsMessage = () => {
146+
if (isNotRendered.current) {
147+
return ''
148+
}
138149
if (total === 0) {
139150
return NoKeysToDisplayText(Pages.workbench(instanceId), onNoKeysLinkClick)
140151
}
@@ -371,7 +382,7 @@ const KeyList = forwardRef((props: Props, ref) => {
371382
columns={columns}
372383
loadMoreItems={onLoadMoreItems}
373384
onWheel={onWheelSearched}
374-
loading={loading}
385+
loading={loading || !firstDataLoaded}
375386
items={itemsRef.current}
376387
totalItemsCount={keysState.total ? keysState.total : Infinity}
377388
scanned={isSearched || isFiltered ? keysState.scanned : 0}

0 commit comments

Comments
 (0)