Skip to content

Fix issue #19: prevent negative timing metrics in escrows#37

Open
crtahlin wants to merge 1 commit intomoltfrom
fix/issue-19-negative-timing-values
Open

Fix issue #19: prevent negative timing metrics in escrows#37
crtahlin wants to merge 1 commit intomoltfrom
fix/issue-19-negative-timing-values

Conversation

@crtahlin
Copy link
Contributor

@crtahlin crtahlin commented Feb 3, 2026

Summary

  • Add validation to upsertEscrow() to only store timing metrics (time_to_fund, time_to_release, time_to_claim) when they are >= 0
  • Add cleanupInvalidTimingMetrics() method to fix existing bad data by recalculating from timestamps or setting to NULL
  • Add tests for both prevention and cleanup functionality

Test plan

  • Unit tests added for negative timing prevention
  • Unit tests added for cleanup method
  • Manual verification on staging with existing bad data

Closes #19

- Add validation to upsertEscrow() to only store timing metrics
  (time_to_fund, time_to_release, time_to_claim) when they are >= 0
- Add cleanupInvalidTimingMetrics() method to fix existing bad data
  by recalculating from timestamps or setting to NULL
- Add tests for both prevention and cleanup functionality

Closes #19
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.

Data quality: Negative time_to_release values in escrows

2 participants