@@ -29,6 +29,7 @@ import { ClientMetadata } from 'src/common/models';
29
29
import { DatabaseClientFactory } from 'src/modules/database/providers/database.client.factory' ;
30
30
import { RedisClient } from 'src/modules/redis/client' ;
31
31
import { checkIfKeyExists , checkIfKeyNotExists } from 'src/modules/browser/utils' ;
32
+ import { convertArrayReplyToObject } from 'src/modules/redis/utils' ;
32
33
33
34
@Injectable ( )
34
35
export class StreamService {
@@ -55,10 +56,10 @@ export class StreamService {
55
56
56
57
await checkIfKeyNotExists ( keyName , client ) ;
57
58
58
- const info = await client . sendCommand ( [
59
+ const info = convertArrayReplyToObject ( await client . sendCommand ( [
59
60
BrowserToolStreamCommands . XInfoStream ,
60
61
keyName ,
61
- ] ) ;
62
+ ] ) as string [ ] ) ;
62
63
63
64
let entries = [ ] ;
64
65
if ( sortOrder && sortOrder === SortOrder . Asc ) {
@@ -71,10 +72,10 @@ export class StreamService {
71
72
72
73
return plainToClass ( GetStreamEntriesResponse , {
73
74
keyName,
74
- total : info [ 1 ] ,
75
- lastGeneratedId : info [ 7 ] . toString ( ) ,
76
- firstEntry : StreamService . formatArrayToDto ( info [ 11 ] ) ,
77
- lastEntry : StreamService . formatArrayToDto ( info [ 13 ] ) ,
75
+ total : info [ 'length' ] ,
76
+ lastGeneratedId : info [ 'last-generated-id' ] . toString ( ) ,
77
+ firstEntry : StreamService . formatArrayToDto ( info [ 'first-entry' ] ) ,
78
+ lastEntry : StreamService . formatArrayToDto ( info [ 'last-entry' ] ) ,
78
79
entries,
79
80
} ) ;
80
81
} catch ( error ) {
0 commit comments