Skip to content

Keep relative times unresolved when their offsets are too large. - #1561

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
virtue039:fix/time-resolution-check-duration-construction
Dec 1, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
virtue039:fix/time-resolution-check-duration-construction

Conversation

@virtue039

Copy link
Copy Markdown
Contributor

Why

An out-of-range relative offset could panic while constructing a Chrono duration, before the resolver reached its checked date arithmetic.

What changes

Use checked duration construction for week, day, hour, minute, and second offsets so unrepresentable values follow the existing unresolved path.

How it was checked

The anchored interpretation regression panicked on the old implementation and now remains unresolved for all five fixed-length units.

  • Commit 0228c60 on macOS arm64, based on dev at 87a83b9.
  • Passed cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings.
  • Cargo workspace tests passed (1871 tests), with a dedicated PostgreSQL 16.15 database, pgvector, and Poppler enabled.
  • pnpm test passed (356 tests). The benchmark helper suite passed (15 tests).
  • Rechecked the branch as a clean merge into current dev at 2614d99. The combined integration checkout passed Rust formatting, Clippy, the Rust workspace suite (1877 passed, 6 ignored), pnpm test (376 passed), TypeScript, the production build, and benchmark helper tests (15 passed). The first Rust workspace run hit a Tantivy lock in an unchanged search-recovery test. The full retry passed with four test threads.

Before review

  • The commit is signed off under the DCO.

Signed-off-by: Virtue039 <77153652+virtue039@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the checked arithmetic is minimal and the test covers all five units. Merging.

@WaylandYang
WaylandYang merged commit 101e90a into deeplethe:dev Dec 1, 2026
6 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

Development

Successfully merging this pull request may close these issues.

2 participants