fix: correct SessionStats type mismatch for date fields#562
Closed
github-actions[bot] wants to merge 1 commit intodevfrom
Closed
fix: correct SessionStats type mismatch for date fields#562github-actions[bot] wants to merge 1 commit intodevfrom
github-actions[bot] wants to merge 1 commit intodevfrom
Conversation
Fixed TypeScript type errors in session-stats.tsx: - Changed firstRequestAt/lastRequestAt types from 'string | null' to 'Date | string | null' - This aligns with aggregateSessionStats return type which uses Date objects - Also removed unused Tooltip imports (pre-existing lint issue) - Reorganized imports per biome lint rules CI Run: https://github.com/ding113/claude-code-hub/actions/runs/20785613467 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
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.
Greptile Overview
Greptile Summary
This PR fixes a TypeScript type mismatch where
SessionStatscomponent expectedstring | nullfor date fields, butaggregateSessionStatsreturnsDate | nullfrom the database.Changes made:
firstRequestAtandlastRequestAttypes fromstring | nulltoDate | string | nullin both theSessionStatsPropsinterface andTimeRowfunction parameterWhy this is safe:
TimeRowfunction already usesnew Date(date)which handles both Date objects and strings correctlyDate→aggregateSessionStatsreturnsDate | null→getSessionDetailspasses it through → Component now correctly accepts itConfidence Score: 5/5
new Date()constructor. The changes are minimal, well-documented, and include cleanup of unused imports. All tests pass (typecheck and lint verified).Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant UI as SessionStats Component participant Client as SessionMessagesClient participant Action as getSessionDetails participant Repo as aggregateSessionStats participant DB as Database Client->>Action: getSessionDetails(sessionId) Action->>Repo: aggregateSessionStats(sessionId) Repo->>DB: SQL query with min/max createdAt DB-->>Repo: firstRequestAt: Date, lastRequestAt: Date Repo-->>Action: stats with Date | null fields Action-->>Client: sessionStats with Date | null Client->>UI: <SessionStats stats={sessionStats} /> UI->>UI: TimeRow receives Date | string | null UI->>UI: new Date(date) handles both types