Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dievazqu
Copy link
Contributor

@dievazqu dievazqu commented Nov 2, 2023

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 and priceFetchedAt).
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.

@@ -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(
Copy link
Contributor Author

@dievazqu dievazqu Mar 7, 2024

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant