-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tokens-info): Refactor delete missing keys for keep internal keys #285
base: main
Are you sure you want to change the base?
Conversation
@@ -28,17 +28,20 @@ async function main() { | |||
await firebaseClient.writeToPath(rtdbLocation, data) | |||
console.log(`Wrote data to ${rtdbLocation}.`) | |||
} else { | |||
let updateRequest = data | |||
if (overrideType.deleteMissingKeys) { | |||
const deleteMissingKeys = deleteMissingKeysUpdateRequest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this might a bit misleading, but this was only removing missing keys in the root level, so basically it was removing the whole token data if not present.
@@ -1,14 +1,14 @@ | |||
import Joi from 'joi' | |||
|
|||
export class OverrideType { | |||
static readonly OverrideAll = new OverrideType(true, true) | |||
static readonly OnlyUpdates = new OverrideType(false, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't used.
Description
For the tokens list, we were only adding new fields to firebase. This was to avoid overriding some fields that are updated from the price service (
historicalUsdPrices
,usdPrice
andpriceFetchedAt
).This didn't allow us to remove fields (which is needed to disable swaps for example).
This PR changes the logic, so now we only keep some specific fields, and we remove all other unexpected fields.