Conversation
🦋 Changeset detectedLatest commit: 7d11376 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| message: 'base must be in the format of ${TICKER}_${MARKET}', | ||
| }) | ||
| } | ||
| req.requestContext.data.rawEndpoint = req.requestContext.requestEndpointName |
There was a problem hiding this comment.
Do we need this? Is the requestContext not also available in the transport?
There was a problem hiding this comment.
We need to inject the raw endpoint into the request itself because we need it to match the cache key when we generate the response from ws messages.
Another way to do it would be to modify the base itself to include the endpoint names
1 request comes in, it will be able to generate two cache entries, the two cache entry need to have different cache key, so we need something more than the request itself to distinguish (here adding a new param into request)
| export const inputParameters = new InputParameters( | ||
| { | ||
| ...stockEndpointInputParametersDefinition, | ||
| rawEndpoint: { |
There was a problem hiding this comment.
Why is this available in the params? Isn't it provided by the framework?
There was a problem hiding this comment.
Framework strip endpoint out before passing it down, so we don't have access to that here.
| const volume = msg?.size | ||
| const time = coverTimeToMs(msg?.unixTimestamp) | ||
|
|
||
| if (isMessageOld(time)) { |
There was a problem hiding this comment.
Does it matter how old it is? If there are no newer messages it's still the most recent data, isn't it?
There was a problem hiding this comment.
I think here we are preventing server from re-playing an old message, we don't have anything like this in our other ws. This comes from SA as
it is not a client or product’s requirement. we added it as a security measure to avoid writing stale data. if this is already managed elsewhere, feel free to remove that business logic from the adapter.
Can remove it if we think this is not important
| setEnvVariables, | ||
| TestAdapter, | ||
| } from '@chainlink/external-adapter-framework/util/testing-utils' | ||
| import FakeTimers from '@sinonjs/fake-timers' |
There was a problem hiding this comment.
Why use sinon fake timers rather than stubbing Date.now or jest.useFakeTimers like we normally do?
There was a problem hiding this comment.
FakeTimers also widely used in our codebase
Closes #OPDATA-6773
Implement the price endpoint with the following special cases:
Quality Assurance
infra-k8sconfiguration file.adapter-secretsconfiguration file.test-payload.jsonfile with relevant requests.feature/x,chore/x,release/x,hotfix/x,fix/x) or is created from Jira.