Skip to content

fix(token): day_string epoch fallback + rollup scan returns error not panic#261

Merged
kengio merged 1 commit into
mainfrom
fix/copilot-v3412-round3
Jul 12, 2026
Merged

fix(token): day_string epoch fallback + rollup scan returns error not panic#261
kengio merged 1 commit into
mainfrom
fix/copilot-v3412-round3

Conversation

@kengio

@kengio kengio commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Copilot round-3 findings on v3.4.12 (tag still held):

  1. token_gain::day_string — still used Utc::now() fallback for an out-of-range ts, the exact behavior the new rollup::utc_or_epoch avoids. Now falls back to the Unix EPOCH so both agree (corrupt ts → 1970, self-flagging, not today).
  2. rollup::scan.expect() on a malformed key would crash the process on an externally-corrupted redb. Returns a new RollupError::MalformedKey instead (the fn already returns Result). + test.

fmt + clippy clean; rollup + token_gain tests pass.

… panic

Post-merge Copilot round-3 findings on v3.4.12:
- token_gain::day_string still fell back to Utc::now() for an out-of-range ts —
  the exact behavior the new rollup utc_or_epoch avoids. Match it (Unix EPOCH)
  so both agree; a corrupt ts buckets under 1970, not today.
- rollup::scan used .expect() on a malformed key → process crash on an
  externally corrupted redb. Return a new RollupError::MalformedKey instead
  (the fn already returns Result). Add a test.
@kengio kengio merged commit 80dafe8 into main Jul 12, 2026
15 checks passed
@kengio kengio deleted the fix/copilot-v3412-round3 branch July 12, 2026 16:21
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.

1 participant