Skip to content

fix(core): handle invalid dates in debug serialization - #1460

Open
Jun516 wants to merge 1 commit into
VoltAgent:mainfrom
Jun516:fix/debug-invalid-dates
Open

Jun516 wants to merge 1 commit into
VoltAgent:mainfrom
Jun516:fix/debug-invalid-dates

Conversation

@Jun516

@Jun516 Jun516 commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary

Avoid a RangeError when serializeValueForDebug receives an invalid Date, including within arrays, while preserving valid date formatting.

Changed files

  • packages/core/src/utils/serialization/index.ts
  • packages/core/src/utils/serialization/invalid-date.spec.ts

Validation

Isolated exact-source TS harness: 1 pass/2 fail -> 3/3 pass; TypeScript transpile passed; git apply --check on matched fixture.

Limitations: Full-repository lint, type checks and package CI were not run in this environment. Please evaluate the CI results of the final upstream PR. This change is independent of the user's other PRs.

Notes

  • Confirmed against the source Blob SHAs recorded in the review manifest.
  • AI-assisted analysis, local patch preparation, and isolated tests; the contributor is responsible for all code and scope.

@changeset-bot

changeset-bot Bot commented Oct 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4415fee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d37f88b9-346a-4195-9236-47f2a7d2c6ee
📥 Commits

Reviewing files that changed from the base of the PR and between 72a46c7 and 4415fee.

📒 Files selected for processing: 2
  • packages/core/src/utils/serialization/index.ts
  • packages/core/src/utils/serialization/invalid-date.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

serializeValueForDebug now returns "[Date: Invalid Date]" for invalid dates. Tests check valid-date formatting, invalid-date formatting without throwing, and invalid dates inside arrays.

Changes: Date Serialization

Layer / File(s) Summary
Invalid date formatting
packages/core/src/utils/serialization/index.ts, packages/core/src/utils/serialization/invalid-date.spec.ts
serializeValueForDebug returns "[Date: Invalid Date]" for invalid dates. Tests cover valid dates, invalid dates, and invalid dates inside arrays.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4415f

The change handles invalid dates in debug serialization while preserving valid-date formatting. No remaining behavior or integration risk is identified, so the PR is ready to merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the change and lists validation details, but it omits the required PR checklist, explicit current behavior, explicit new behavior, linked issue or fixes reference, documentati… Add the required PR checklist and complete the template sections for current behavior, new behavior, linked issue or fixes reference, documentation updates, changeset updates, and reviewer notes.
Passed Passed checks: 4 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: handling invalid dates in core debug serialization.
Full details: Description check

Explanation

The description explains the change and lists validation details, but it omits the required PR checklist, explicit current behavior, explicit new behavior, linked issue or fixes reference, documentation status, and changeset status.

Resolution

Add the required PR checklist and complete the template sections for current behavior, new behavior, linked issue or fixes reference, documentation updates, changeset updates, and reviewer notes.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

View guided diff | Re-trigger cubic

This branch has not been deployed

No deployments
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