跳到主要内容
ArcBlock Community

Invalid Validation Error on Auto Top-Up Configuration

JM “cryptotestnet” Morales
开发者
aignebugwont-fix

image.png

🧾 Description

When saving the Auto Top-Up configuration, the system shows an error message:

'daily_limits.max_attempts' must be an integer

even though the user correctly entered 0.5 ABT in the Daily Top-up Amount Limit and Daily Top-up Attempts Limit fields.

This indicates a type mismatch or validation logic bug — the field visually accepts decimal values, but the backend expects an integer input.

🔁 Steps to Reproduce

  1. Go to https://hub.aigne.io/ai-kit/credit-usage.
  2. Enable Auto Top-Up.
  3. Set:
  • When credits are below: 0.01
  • Top-up Amount per Time: 0.5 ABT
  • Daily Top-up Amount Limit: 0.5 ABT
  • Daily Top-up Attempts Limit: 0.5
  1. Click Save Configuration.
  2. Observe the red error message: > 'daily_limits.max_attempts' must be an integer >

✅ Expected Behavior

  • The system should allow decimal values (like 0.5) in the “Daily Top-up Attempts Limit” and “Daily Top-up Amount Limit” fields, or clearly restrict input to integers if decimals are not supported.
  • Validation should match the frontend input format (ABT token amounts can be fractional).

❌ Actual Behavior

  • The input is valid and formatted correctly.
  • The backend validation incorrectly rejects it with a misleading error message.

🧰 Environment

  • Platform: AIGNE Hub
  • Device: Desktop
  • Browser: Chrome (Latest)
  • OS: Windows 11
  • Reproducibility: 100%

📊 Impact

  • Severity: Medium
  • Priority: High
  • Impact:
    • Users cannot save a valid Auto Top-Up configuration.
    • May block automatic credit replenishment, leading to failed model usage.

🧠 Suggested Fix

  1. Align frontend and backend validation rules — allow fractional ABT values for top-up fields.
  2. If integer is required, restrict input field and update the placeholder to guide the user.
  3. Update error message to specify which field failed validation and why.

2 条回复

Xiao Fang11个月前

image.png

This is the daily top-up limit for the number of automatic recharges. The number of times has no concept of decimals and can only be limited to integers.

JM “cryptotestnet” Morales11个月前

I would like a 1.25 top-up, for it is my lucky number.

回复