Skip to content

[Bug][Credits] Gifted credits incorrectly categorized as Package credits #1085

Description

@shangxinyu1

Environment

Platform: macOS (per screenshot) / Windows
Version: 0.1.12-nightly.20260414
Component: Credits / Balance UI / Backend State Mapping

Steps to Reproduce

  1. Receive gifted credits (e.g., via a campaign or trial gift).
  2. Open the Nexu client and hover/click on the credit balance in the bottom-left corner to see the detailed breakdown.

Actual Behavior

  • The 赠送积分 (Gifted credits) field incorrectly displays 0.
  • The gifted credits appear to be merged into the 套餐积分 (Package credits) category (showing 480 in the screenshot).

Expected Behavior

  • Credits should be accurately categorized based on their source (Gifted vs. Package).
  • Gifted credits should be displayed under the "赠送积分" field.
  • Package credits should only reflect the balance originating from the user's purchased plan or package.

Impact

Severity: P1 (High) - Requirement mismatch.

  • Confuses users regarding the origin and potential expiration dates of their credits (gifted credits usually have different expiration rules).
  • Affects the transparency of the credit system and billing accuracy.

Root Cause Speculation

  1. Frontend Mapping Error: The UI component might be incorrectly mapping all non-subscription credits to the packageCredits state field.
  2. API Data Aggregation: The backend API might be returning a pre-aggregated total that lacks the necessary granularity for the frontend to distinguish between types.
  3. Logic Regression: A recent change in the credit accounting service might have accidentally combined these two credit pools.

Screenshot

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcreditpriority:p0P0-critical: Blocking users, must fix immediately

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions