Skip to main content

Invalid Validation Error on Auto Top-Up Configuration

JM โ€œcryptotestnetโ€ Morales
developers
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 replies

Xiao Fang12 months ago

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.

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

Reply