cardano-db-sync icon indicating copy to clipboard operation
cardano-db-sync copied to clipboard

1421 update logs for Unicode Nul character

Open Cmdv opened this issue 1 year ago • 3 comments

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.

Cmdv avatar Feb 20 '24 12:02 Cmdv

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

sgillespie avatar Feb 21 '24 16:02 sgillespie

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.

Cmdv avatar Feb 21 '24 18:02 Cmdv

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 :+1:

sgillespie avatar Mar 01 '24 20:03 sgillespie