fix(mirror): tolerate NULL hash on v2 sources with hash logs disabled#1484
Conversation
v2 ledgers with LEDGER_FEATURE_HASH_LOGS disabled leave logs.hash NULL, which failed the postgres source scan with: scanning log row: can't scan into dest[4] (col: encode): cannot scan NULL into *string COALESCE the hex-encoded hash to '' at the SQL layer. V2Log.Hash is not consumed downstream, so the empty-string default preserves current behavior.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Approve — automated reviewThe change narrowly addresses nullable v2 log hashes by coercing the SQL expression to a non-null text value before scanning into a Go string. No downstream usage or compatibility issue was found in the modified path. No findings. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## release/v3.0 #1484 +/- ##
================================================
+ Coverage 73.66% 74.09% +0.43%
================================================
Files 388 388
Lines 39747 39734 -13
================================================
+ Hits 29278 29442 +164
+ Misses 7951 7767 -184
- Partials 2518 2525 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
v2 ledgers with
LEDGER_FEATURE_HASH_LOGSdisabled leavelogs.hashNULL, breaking the postgres mirror source scan:Coalesce the hex-encoded hash to
''at the SQL layer.V2Log.Hashis not consumed downstream, so the empty-string default preserves current behavior.Test plan
hash-logsfeature disabled and verify the mirror progresses past the first log page instead of erroring on scan.