Skip to content

Commit a783526

Browse files
Merge branch 'bugfix/regresion-fixes' of https://github.com/RedisInsight/RedisInsight into bugfix/RI-3822/3742/3788_regression_bugs
2 parents 1aa596f + a9d52ba commit a783526

File tree

64 files changed

+593
-239
lines changed

Some content is hidden

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

64 files changed

+593
-239
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ renderer.prod.js.map
4646
redisinsight/ui/style.css
4747
redisinsight/ui/style.css.map
4848
redisinsight/ui/dist
49+
redisinsight/api/commands
50+
redisinsight/api/guides
51+
redisinsight/api/tutorials
52+
redisinsight/api/content
4953
dist
5054
distWeb
5155
dll

redisinsight/api/config/default.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default {
5656
buildType: process.env.BUILD_TYPE || 'ELECTRON',
5757
appVersion: process.env.APP_VERSION || '2.0.0',
5858
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 10000,
59+
ftSearchRequestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 45_000,
5960
excludeRoutes: [],
6061
},
6162
sockets: {

redisinsight/api/config/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export default {
22
server: {
33
env: 'test',
44
requestTimeout: 1000,
5+
ftSearchRequestTimeout: 1000,
56
},
67
profiler: {
78
logFileIdleThreshold: parseInt(process.env.PROFILER_LOG_FILE_IDLE_THRESHOLD, 10) || 1000 * 2, // 3sec

redisinsight/api/src/common/interceptors/timeout.interceptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class TimeoutInterceptor implements NestInterceptor {
1818

1919
private readonly message: string;
2020

21-
constructor(message?: string) {
21+
constructor(message: string = 'Request timeout') {
2222
this.message = message;
2323
}
2424

redisinsight/api/src/constants/error-messages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default {
1111
WRONG_DATABASE_TYPE: 'Wrong database type.',
1212
CONNECTION_TIMEOUT:
1313
'The connection has timed out, please check the connection details.',
14+
FT_SEARCH_COMMAND_TIMED_OUT: 'Command timed out.',
1415
AUTHENTICATION_FAILED: () => 'Failed to authenticate, please check the username or password.',
1516
INCORRECT_DATABASE_URL: (url) => `Could not connect to ${url}, please check the connection details.`,
1617
INCORRECT_CERTIFICATES: (url) => `Could not connect to ${url}, please check the CA or Client certificate.`,
@@ -52,4 +53,5 @@ export default {
5253
REDIS_MODULE_IS_REQUIRED: (module: string) => `Required ${module} module is not loaded.`,
5354
APP_SETTINGS_NOT_FOUND: () => 'Could not find application settings.',
5455
SERVER_INFO_NOT_FOUND: () => 'Could not find server info.',
56+
INCREASE_MINIMUM_LIMIT: (count: string) => `Set MAXSEARCHRESULTS to at least ${count}.`,
5557
};

redisinsight/api/src/constants/redis-error-codes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export enum RedisErrorCodes {
1313
BusyGroup = 'BUSYGROUP',
1414
NoGroup = 'NOGROUP',
1515
UnknownCommand = 'unknown command',
16+
RedisearchLimit = 'LIMIT',
1617
}
1718

1819
export enum CertificatesErrorCodes {

redisinsight/api/src/modules/analytics/telemetry.base.service.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ describe('TelemetryBaseService', () => {
3333

3434
describe('sendEvent', () => {
3535
it('should emit event', () => {
36-
service.sendEvent(TelemetryEvents.RedisInstanceAdded, { data: 'Some data' });
36+
service.sendEvent(TelemetryEvents.RedisInstanceAdded, { data: 'Some data', command: 'lowercase' });
3737

3838
expect(eventEmitter.emit).toHaveBeenCalledWith(AppAnalyticsEvents.Track, {
3939
event: TelemetryEvents.RedisInstanceAdded,
40-
eventData: { data: 'Some data' },
40+
eventData: { data: 'Some data', command: 'LOWERCASE' },
4141
});
4242
});
4343
it('should emit event with empty event data', () => {
@@ -87,13 +87,18 @@ describe('TelemetryBaseService', () => {
8787
});
8888
});
8989
it('should emit event with additional event data', () => {
90-
service.sendFailedEvent(TelemetryEvents.RedisInstanceAddFailed, httpException, { data: 'Some data' });
90+
service.sendFailedEvent(
91+
TelemetryEvents.RedisInstanceAddFailed,
92+
httpException,
93+
{ data: 'Some data', command: 'lowercase' },
94+
);
9195

9296
expect(eventEmitter.emit).toHaveBeenCalledWith(AppAnalyticsEvents.Track, {
9397
event: TelemetryEvents.RedisInstanceAddFailed,
9498
eventData: {
9599
error: 'Internal Server Error',
96100
data: 'Some data',
101+
command: 'LOWERCASE',
97102
},
98103
});
99104
});

redisinsight/api/src/modules/analytics/telemetry.base.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isString } from 'lodash';
12
import { EventEmitter2 } from '@nestjs/event-emitter';
23
import { HttpException } from '@nestjs/common';
34
import { AppAnalyticsEvents } from 'src/constants';
@@ -13,7 +14,10 @@ export abstract class TelemetryBaseService {
1314
try {
1415
this.eventEmitter.emit(AppAnalyticsEvents.Track, {
1516
event,
16-
eventData,
17+
eventData: {
18+
...eventData,
19+
command: isString(eventData['command']) ? eventData['command'].toUpperCase() : eventData['command'],
20+
},
1721
});
1822
} catch (e) {
1923
// continue regardless of error
@@ -27,6 +31,7 @@ export abstract class TelemetryBaseService {
2731
eventData: {
2832
error: exception.getResponse()['error'] || exception.message,
2933
...eventData,
34+
command: isString(eventData['command']) ? eventData['command'].toUpperCase() : eventData['command'],
3035
},
3136
});
3237
} catch (e) {

redisinsight/api/src/modules/browser/dto/keys.dto.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,12 @@ export class GetKeysWithDetailsResponse {
319319
description: 'Node port. In case when we are working with cluster',
320320
})
321321
port?: number;
322+
323+
@ApiPropertyOptional({
324+
type: Number,
325+
description:
326+
'The maximum number of results.'
327+
+ ' For RediSearch this number is a value from "FT.CONFIG GET maxsearchresults" command.'
328+
})
329+
maxResults?: number;
322330
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ describe('Cluster Scanner Strategy', () => {
943943
scanned: 10,
944944
},
945945
]);
946-
expect(strategy.getKeyInfo).toHaveBeenCalledWith(clusterClient, key);
946+
expect(strategy.getKeyInfo).toHaveBeenCalledWith(clusterClient, Buffer.from(key));
947947
expect(strategy.scanNodes).not.toHaveBeenCalled();
948948
});
949949
it('should find exact key when match is escaped glob patter', async () => {
@@ -973,7 +973,7 @@ describe('Cluster Scanner Strategy', () => {
973973
scanned: 10,
974974
},
975975
]);
976-
expect(strategy.getKeyInfo).toHaveBeenCalledWith(clusterClient, searchPattern);
976+
expect(strategy.getKeyInfo).toHaveBeenCalledWith(clusterClient, Buffer.from(searchPattern));
977977
expect(strategy.scanNodes).not.toHaveBeenCalled();
978978
});
979979
it('should find exact key with correct type', async () => {

0 commit comments

Comments
 (0)