DEV Community

Cover image for Developing an Import UX: Validating Bulk Avatar Requests Before Submission
Avatarlookup
Avatarlookup

Posted on

Developing an Import UX: Validating Bulk Avatar Requests Before Submission

When building a dashboard for bulk identity-signal processing, the user experience often hinges on how you handle file uploads before they ever hit the service boundary. By implementing robust client-side validation, you can prevent common errors, reduce unnecessary processing cycles, and provide immediate feedback to your users.

The Mental Model: Pre-Submit Validation

Users often view file uploads as a "fire and forget" action. However, bulk avatar processing—which supports sources like WhatsApp, Telegram, Viber, LINE, Zalo, MAX, Gmail, Yandex, and Mail.ru—has specific technical constraints. Your import flow should treat the file as a data object that must be validated against these constraints before the user clicks "Upload."

Core Constraints Checklist

Before initiating a task, ensure your frontend enforces these rules:

  1. Format Support: Only CSV, TXT, and XLSX are accepted.
  2. File Size: The file must not exceed 10 MB.
  3. Row Count: Each file is limited to 100,000 entries.

Implementing Pre-Submit Checks

Rather than waiting for a server-side error, use the browser's File API to inspect the metadata. This allows you to surface errors in the UI immediately.

Conceptual Validation Logic

// Conceptual: Client-side validation logic
function validateFile(file) {
 const MAX_SIZE_BYTES = 10 * 1024 * 1024; // 10 MB
 const MAX_ROWS = 100000;

 // Check file extension
 const validExtensions = ['csv', 'txt', 'xlsx'];
 if (!validExtensions.includes(file.extension)) {
 return { valid: false, message: "Unsupported file format." };
 }

 // Check file size
 if (file.size > MAX_SIZE_BYTES) {
 return { valid: false, message: "File exceeds 10MB limit." };
 }

 return { valid: true };
}
Enter fullscreen mode Exit fullscreen mode

Designing Feedback and Empty States

Feedback Copy

Avoid technical jargon in your error messages. Instead of "400 Bad Request: File too large," use "This file is over 10MB. Please reduce the number of entries or split the file into smaller parts."

Empty-State Behavior

If a user uploads a file with zero valid rows, the UI should clearly state that no processing will occur. Distinguish between a "failed" file (malformed data) and an "empty" file (valid format, no content) to help the user understand why the system isn't returning results.

Important Considerations for Avatar Data

When designing your results dashboard, remember that avatar lookup is not identity verification, KYC, or proof of account ownership.

  • Result Interpretation: Core results distinguish between "avatar available," "no avatar," and "undetermined." Note that "no avatar" does not mean an account does not exist, and "undetermined" is not a negative result.
  • Algorithmic Estimates: If you display appearance attributes (such as estimated age or gender), label them clearly as algorithmic estimates rather than verified demographic facts.

By building these guardrails into your import flow, you create a more predictable and helpful experience for your users while ensuring your application respects the underlying service boundaries.

For more information on supported sources and capabilities, see the official documentation.

This article was drafted with AI assistance and reviewed before publishing.

Top comments (0)