Skip to content

Comments

Auto-fix CI failures for PR #370: resolve null-to-undefined type errors#375

Closed
github-actions[bot] wants to merge 1 commit intodevfrom
claude-fix-pr-370-20366971654
Closed

Auto-fix CI failures for PR #370: resolve null-to-undefined type errors#375
github-actions[bot] wants to merge 1 commit intodevfrom
claude-fix-pr-370-20366971654

Conversation

@github-actions
Copy link
Contributor

CI Auto-Fix

Original PR: #370
Failed CI Run: Non-Main Branch CI/CD

Fixes Applied

File Fix Type
src/actions/users.ts:366 Added ?? undefined to dailyQuota in addUser Type coercion
src/actions/users.ts:548 Added ?? undefined to dailyQuota in createUserOnly Type coercion
src/actions/users.ts:701-706 Added ?? undefined to limit fields in editUser Type coercion
src/app/.../user-form.tsx:121,139 Added ?? undefined to dailyQuota Type coercion
src/repository/user.ts:160-172 Changed null to undefined for limit fields Type coercion

Root Cause

The type error occurred because fields like dailyQuota could be number | null | undefined, but the target types only accept number | undefined. This fix applies the nullish coalescing operator (?? undefined) to convert null to undefined, which is consistent with the existing pattern used for other limit fields in the codebase.

Not Auto-Fixable

The following errors require human review:

File Error Reason
key-edit-section.tsx:175,216 Expected 2 arguments, but got 1 Batch update pattern intentionally passes single object to onChange, but function signature expects 2 args. The comment says "Batch update to avoid race condition" - fixing this could introduce race conditions.
user-edit-section.tsx:216,246 Expected 2 arguments, but got 1 Same batch update pattern issue

These batch update calls were introduced in commit caa6c01 and require a design decision on how to properly support batch updates without race conditions.

Verification

  • bun run typecheck - reduces errors from 14+ to 4 (only the batch update signature mismatches remain)
  • No logic changes made - only type coercion using existing codebase patterns

Auto-generated by Claude AI

Fixed type errors where 'number | null | undefined' was not assignable
to 'number | undefined'. Applied nullish coalescing (?? undefined) to
convert null to undefined for the following fields:

- src/actions/users.ts: dailyQuota, limit5hUsd, limitWeeklyUsd,
  limitMonthlyUsd, limitTotalUsd, limitConcurrentSessions in addUser,
  createUserOnly, and editUser functions
- src/app/[locale]/dashboard/_components/user/forms/user-form.tsx:
  dailyQuota in editUser and addUser calls
- src/repository/user.ts: dailyLimitUsd, limit5hUsd, limitWeeklyUsd,
  limitMonthlyUsd - changed null to undefined to match interface types

CI Run: https://github.com/ding113/claude-code-hub/actions/runs/20366971654

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ding113 ding113 closed this Dec 19, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Dec 19, 2025
@ding113 ding113 deleted the claude-fix-pr-370-20366971654 branch December 23, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant