Skip to content

Commit 3134ac1

Browse files
authored
Merge pull request #2834 from RedisInsight/latest
Latest to main
2 parents 6752c81 + 80a927a commit 3134ac1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+309
-256
lines changed

redisinsight/api/config/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
tlsKey: process.env.SERVER_TLS_KEY,
6161
staticContent: !!process.env.SERVER_STATIC_CONTENT || false,
6262
buildType: process.env.BUILD_TYPE || 'ELECTRON',
63-
appVersion: process.env.APP_VERSION || '2.36.0',
63+
appVersion: process.env.APP_VERSION || '2.38.0',
6464
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 25000,
6565
excludeRoutes: [],
6666
excludeAuthRoutes: [],

redisinsight/api/config/swagger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SWAGGER_CONFIG: Omit<OpenAPIObject, 'paths'> = {
55
info: {
66
title: 'RedisInsight Backend API',
77
description: 'RedisInsight Backend API',
8-
version: '2.36.0',
8+
version: '2.38.0',
99
},
1010
tags: [],
1111
};

redisinsight/api/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redisinsight-api",
3-
"version": "2.36.0",
3+
"version": "2.38.0",
44
"description": "RedisInsight API",
55
"private": true,
66
"author": {
@@ -42,7 +42,8 @@
4242
"word-wrap": "1.2.4",
4343
"mocha/minimatch": "^3.0.5",
4444
"@nestjs/platform-socket.io/socket.io": "^4.7.1",
45-
"**/semver": "^7.5.2"
45+
"**/semver": "^7.5.2",
46+
"winston-daily-rotate-file/**/file-stream-rotator": "^1.0.0"
4647
},
4748
"dependencies": {
4849
"@nestjs/common": "^9.0.11",

redisinsight/api/src/modules/browser/services/keys-business/scanner/strategies/standalone.strategy.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,40 @@ describe('Standalone Scanner Strategy', () => {
101101
null,
102102
);
103103
});
104+
it('should scan 2000 items when count provided more then 2k', async () => {
105+
const args = { ...getKeysDto, count: 10_000, match: '*' };
106+
jest.spyOn(Utils, 'getTotal').mockResolvedValue(mockGetTotalResponse_1);
107+
108+
when(browserTool.execCommand)
109+
.calledWith(
110+
mockBrowserClientMetadata,
111+
BrowserToolKeysCommands.Scan,
112+
expect.anything(),
113+
null,
114+
)
115+
.mockResolvedValue([0, [getKeyInfoResponse.name]]);
116+
117+
strategy.getKeysInfo = jest.fn().mockResolvedValue([getKeyInfoResponse]);
118+
119+
const result = await strategy.getKeys(mockBrowserClientMetadata, args);
120+
121+
expect(result).toEqual([
122+
{
123+
...mockNodeEmptyResult,
124+
total: 1,
125+
scanned: 2000,
126+
keys: [getKeyInfoResponse],
127+
},
128+
]);
129+
expect(strategy.getKeysInfo).toHaveBeenCalled();
130+
expect(browserTool.execCommand).toHaveBeenNthCalledWith(
131+
1,
132+
mockBrowserClientMetadata,
133+
BrowserToolKeysCommands.Scan,
134+
['0', 'MATCH', args.match, 'COUNT', 2000],
135+
null,
136+
);
137+
});
104138
it('should return keys names and type only', async () => {
105139
const args = {
106140
...getKeysDto, type: 'string', match: 'pattern*', keysInfo: false,

redisinsight/api/src/modules/browser/services/keys-business/scanner/strategies/standalone.strategy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ export class StandaloneStrategy extends AbstractStrategy {
8686
count: number,
8787
type?: RedisDataType,
8888
): Promise<void> {
89+
const COUNT = Math.min(2000, count);
90+
8991
let fullScanned = false;
9092
// todo: remove settings from here. threshold should be part of query?
9193
const settings = await this.settingsService.getAppSettings('1');
@@ -97,7 +99,7 @@ export class StandaloneStrategy extends AbstractStrategy {
9799
node.scanned < settings.scanThreshold
98100
)
99101
) {
100-
let commandArgs = [`${node.cursor}`, 'MATCH', match, 'COUNT', count];
102+
let commandArgs = [`${node.cursor}`, 'MATCH', match, 'COUNT', COUNT];
101103
if (type) {
102104
commandArgs = [...commandArgs, 'TYPE', type];
103105
}
@@ -112,7 +114,7 @@ export class StandaloneStrategy extends AbstractStrategy {
112114
// eslint-disable-next-line no-param-reassign
113115
node.cursor = parseInt(nextCursor, 10);
114116
// eslint-disable-next-line no-param-reassign
115-
node.scanned += count;
117+
node.scanned += COUNT;
116118
node.keys.push(...keys);
117119
fullScanned = node.cursor === 0;
118120
}

redisinsight/api/yarn.lock

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,12 +3919,10 @@ file-entry-cache@^6.0.1:
39193919
dependencies:
39203920
flat-cache "^3.0.4"
39213921

3922-
file-stream-rotator@^0.6.1:
3923-
version "0.6.1"
3924-
resolved "https://registry.yarnpkg.com/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz#007019e735b262bb6c6f0197e58e5c87cb96cec3"
3925-
integrity sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==
3926-
dependencies:
3927-
moment "^2.29.1"
3922+
file-stream-rotator@^0.6.1, file-stream-rotator@^1.0.0:
3923+
version "1.0.0"
3924+
resolved "https://registry.yarnpkg.com/file-stream-rotator/-/file-stream-rotator-1.0.0.tgz#de58379321a1ea6d2938ed5f5a2eff3b7f8b2780"
3925+
integrity sha512-qg5mQO7o+vhS7NPqkrkfJS8qqhz0d17Tnewmb5sUTUKwYe27LKaDtbTuRAtQWkBn6jROuFPVIDF5DtckzokFTQ==
39283926

39293927
file-type@^16.5.4:
39303928
version "16.5.4"
@@ -6201,11 +6199,6 @@ mocha@^8.4.0:
62016199
yargs-parser "20.2.4"
62026200
yargs-unparser "2.0.0"
62036201

6204-
moment@^2.29.1:
6205-
version "2.29.4"
6206-
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
6207-
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
6208-
62096202
62106203
version "2.0.0"
62116204
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"

redisinsight/desktop/src/lib/aboutPanel/aboutPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const ICON_PATH = app.isPackaged
88

99
export const AboutPanelOptions = {
1010
applicationName: 'RedisInsight',
11-
applicationVersion: `${app.getVersion() || '2.36.0'}${
11+
applicationVersion: `${app.getVersion() || '2.38.0'}${
1212
!config.isProduction ? `-dev-${process.getCreationTime()}` : ''
1313
}`,
1414
copyright: `Copyright © ${new Date().getFullYear()} Redis Ltd.`,

redisinsight/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "redisinsight",
33
"productName": "RedisInsight",
44
"private": true,
5-
"version": "2.36.0",
5+
"version": "2.38.0",
66
"description": "RedisInsight",
77
"main": "./dist/main/main.js",
88
"author": {

redisinsight/ui/src/pages/browser/modules/key-details/components/string-details/StringDetails.spec.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { instance, mock } from 'ts-mockito'
33
import { render, screen } from 'uiSrc/utils/test-utils'
4-
import { stringDataSelector } from 'uiSrc/slices/browser/string'
4+
import { stringDataSelector, stringSelector } from 'uiSrc/slices/browser/string'
55
import { Props, StringDetails } from './StringDetails'
66

77
const mockedProps = mock<Props>()
@@ -15,6 +15,9 @@ jest.mock('uiSrc/slices/browser/string', () => ({
1515
data: [49, 50, 51, 52],
1616
}
1717
}),
18+
stringSelector: jest.fn().mockReturnValue({
19+
isCompressed: false
20+
})
1821
}))
1922

2023
jest.mock('uiSrc/slices/browser/keys', () => ({
@@ -64,6 +67,22 @@ describe('StringDetails', () => {
6467
expect(editValueBtn).toHaveProperty('disabled', true)
6568
})
6669

70+
it('should not be able to change value (compressed)', () => {
71+
const stringSelectorMock = jest.fn().mockReturnValue({
72+
isCompressed: true
73+
})
74+
stringSelector.mockImplementation(stringSelectorMock)
75+
76+
render(
77+
<StringDetails
78+
{...mockedProps}
79+
/>
80+
)
81+
82+
const editValueBtn = screen.getByTestId(`${EDIT_VALUE_BTN_TEST_ID}`)
83+
expect(editValueBtn).toHaveProperty('disabled', true)
84+
})
85+
6786
it('"edit-key-value-btn" should render', () => {
6887
const { queryByTestId } = render(<StringDetails {...instance(mockedProps)} />)
6988
expect(queryByTestId('edit-key-value-btn')).toBeInTheDocument()

redisinsight/ui/src/pages/browser/modules/key-details/components/string-details/StringDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const StringDetails = (props: Props) => {
5656
<EditItemAction
5757
title="Edit Value"
5858
tooltipContent={editToolTip}
59-
isEditable={isStringEditable}
59+
isEditable={isStringEditable && isEditable}
6060
onEditItem={() => setEditItem(!editItem)}
6161
/>
6262
)

0 commit comments

Comments
 (0)