Conversation
2ed93f5 to
bfc0dad
Compare
8a59ba9 to
81b4c3b
Compare
81b4c3b to
932cb49
Compare
src/cache/redis.ts
Outdated
| this.keyPrefix = options.keyPrefix || 'schematic:'; | ||
|
|
||
| // Dynamically import Redis to avoid requiring it if not used | ||
| this.initRedisClient(options); |
There was a problem hiding this comment.
Is it okay that we don't await this? Are we concerned that, when redis is used, there could be calls made before the redis client is ready?
There was a problem hiding this comment.
yeah this is how the other datastream versions work kind of fire and let it do its thing
bpapillon
left a comment
There was a problem hiding this comment.
a few more small comments. also, probably we don't want to check in package-lock.json
10d4f05 to
a0828cf
Compare
| sendMessage: jest.fn().mockResolvedValue(undefined), | ||
| }; | ||
|
|
||
| jest.mock('./client', () => { |
There was a problem hiding this comment.
I would have thought the path here would be "./datastrem-client". I don't know that much about jest mocking - why does this work with an incorrect path?
| import * as Schematic from '../api/types'; | ||
|
|
||
| // Mock DatastreamWSClient | ||
| const mockDatastreamWSClientInstanceInstance = { |
There was a problem hiding this comment.
name should maybe be "mockDatastreamWSClientInstance" here?
| await messageHandler({}, companyErrorMessage); | ||
|
|
||
| // Verify warning was logged but no error event was emitted | ||
| expect(mockLogger.warn).toHaveBeenCalledWith({}, 'DataStream error received: Company not found'); |
There was a problem hiding this comment.
Shouldn't these tests be failing now after the logger interface change from the last review pass?
There was a problem hiding this comment.
I wonder if these tests are being skipped for some reason
| try { | ||
| const response = await fetch(this.replicatorHealthURL, { | ||
| method: 'GET', | ||
| // @ts-ignore - timeout is supported in newer Node.js versions |
There was a problem hiding this comment.
I was looking into this ts-ignore, and I'm. not sure I understand this comment- by my understanding is that the AbortController pattern is recommended regardless of node version
https://betterstack.com/community/guides/scaling-nodejs/nodejs-timeouts/
| if (flag?.key) { | ||
| const cacheKey = this.flagCacheKey(flag.key); | ||
| try { | ||
| await this.flagsCacheProvider.set(cacheKey, flag); |
There was a problem hiding this comment.
Any thought of using Promise.all here?
No description provided.