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

1421 update logs for Unicode Nul character #1631

Merged
merged 1 commit into from May 21, 2024
Merged

Conversation

Cmdv
Copy link
Contributor

@Cmdv Cmdv commented Feb 20, 2024

Description

this fixes #1421

The logs were false in that not the whole row was drop, but instead if parsing failed with a Unicode Nul character the specific column it was intended for is recorded as nul.

This also effected a couple of other places so those were updated too.

[db-sync-node:Warning:75] [2024-01-31 11:02:29.12 UTC]  prepareTxMetadata: Column 'json' in table 'metadata' was recorded as null, due to a Unicode NUL character found when trying to parse the json.

This also fixes #1623 as outputting the full json made logs quite perplexing.

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu on version 0.10.1.0 (which can be run with scripts/fourmolize.sh)
  • Self-reviewed the diff

Migrations

  • The pr causes a breaking change of type a,b or c
  • If there is a breaking change, the pr includes a database migration and/or a fix process for old values, so that upgrade is possible
  • Resyncing and running the migrations provided will result in the same database semantically

If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.

@sgillespie
Copy link
Contributor

Column 'json' in table 'metadata' was recorded as null, due to a Unicode NUL character found when trying to parse the json.

This is definitely more clear, but I wonder if it's a little too verbose

@Cmdv
Copy link
Contributor Author

Cmdv commented Feb 21, 2024

This is definitely more clear, but I wonder if it's a little too verbose

how about

The 'json' column in 'metadata' became null due to a Unicode NUL character in the JSON parsing process.

@sgillespie
Copy link
Contributor

This is definitely more clear, but I wonder if it's a little too verbose

how about

The 'json' column in 'metadata' became null due to a Unicode NUL character in the JSON parsing process.

That definitely looks better 👍

@kderme kderme merged commit 80bbd6a into master May 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants