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

Asset metadata overwrite fix #370

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Asset metadata overwrite fix #370

merged 2 commits into from
Jun 20, 2023

Conversation

guggero
Copy link
Member

@guggero guggero commented Jun 19, 2023

Fixes #368.

As @habibitcoin already correctly identified, one of our SQL queries is incorrect and overwrites valid meta information with NULL when importing a proof.

We need to be careful with the ON CONFLICT ... DO UPDATE SET clauses, if
we blindly set xxxx = EXCLUDED.xxxx then we risk overwriting existing
valid values with NULL.
To fix a specific problem with the asset meta, we use COALESCE instead
to avoid overwriting existing values with NULL.
@guggero guggero requested review from ffranr and jharveyb June 19, 2023 09:28
@guggero guggero added the v0.2.1 label Jun 19, 2023
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

Good to know about COALESCE 👍

@habibitcoin
Copy link
Contributor

Woot! Confirmed this works locally as well. Thanks!

Copy link
Collaborator

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

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

LGTM! Now thinking if we need to update other queries to use COALESCE as well.

@guggero guggero added this pull request to the merge queue Jun 20, 2023
Merged via the queue into main with commit 82a893d Jun 20, 2023
11 checks passed
@jharveyb jharveyb deleted the metadata-overwrite-fix branch July 5, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asset meta data is overwritten incorrectly/not passed around correctly when performing receives
4 participants