fix: auto-fix CI type error in SessionStats component#564
Closed
github-actions[bot] wants to merge 1 commit intodevfrom
Closed
fix: auto-fix CI type error in SessionStats component#564github-actions[bot] wants to merge 1 commit intodevfrom
github-actions[bot] wants to merge 1 commit intodevfrom
Conversation
Fixed: - Updated SessionStats interface to accept Date | string | null for firstRequestAt and lastRequestAt - Updated TimeRow function to handle both Date and string types - Applied lint auto-fix for import ordering The type error occurred because aggregateSessionStats returns Date | null for these fields, but SessionStats expected string | null. CI Run: https://github.com/ding113/claude-code-hub/actions/runs/20785862610 Generated with Claude Code
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI Auto-Fix
Original PR: #561
Failed CI Run: Non-Main Branch CI/CD
Fixes Applied
src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-stats.tsxfirstRequestAtandlastRequestAttypes fromstring | nulltoDate | string | nullsrc/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-stats.tsxTimeRowfunction to handle bothDateandstringinputssrc/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-stats.tsxRoot Cause
The
aggregateSessionStatsfunction insrc/repository/message.tsreturnsDate | nullforfirstRequestAtandlastRequestAtfields, but theSessionStatscomponent interface expectedstring | null. This type mismatch caused the build to fail.Not Auto-Fixable
The following pre-existing issues were not addressed as they require human review:
session-stats.tsxVerification
bun run typecheckpassesAuto-generated by Claude AI
Greptile Summary
This PR fixes a TypeScript type mismatch between the
SessionStatscomponent interface and theaggregateSessionStatsdatabase query function. TheaggregateSessionStatsfunction returnsDate | nullfor timestamp fields, but the component expectedstring | null, causing CI build failures.Changes Made:
SessionStatsProps.statsinterface to acceptDate | string | nullforfirstRequestAtandlastRequestAtfieldsTimeRowfunction to handle bothDateobjects andstringinputs with type guard (instanceof Date)Key Points:
The fix is minimal, correct, and safe to merge.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant Client as SessionMessagesClient participant Action as getSessionDetails() participant Repo as aggregateSessionStats() participant DB as Database participant Component as SessionStats Client->>Action: getSessionDetails(sessionId) Action->>Repo: aggregateSessionStats(sessionId) Repo->>DB: SELECT min(createdAt), max(createdAt) DB-->>Repo: Returns Date | null Repo-->>Action: Returns { firstRequestAt: Date | null, lastRequestAt: Date | null } Action-->>Client: sessionStats with Date objects Client->>Component: <SessionStats stats={sessionStats} /> Component->>Component: TimeRow checks instanceof Date Component->>Component: Converts to Date if string, uses directly if Date Component-->>Client: Renders formatted timestamps