8000 Add retry mechanism for failed image uploads in UI · Issue #59 · jra3/mulm · GitHub
[go: up one dir, main page]

Skip to content

Add retry mechanism for failed image uploads in UI #59

Closed

Description

@jra3

Problem

When an image upload fails, users must refresh and start over. There's no retry mechanism in the UI for failed uploads.

Current Behavior

  1. User selects/drags images
  2. Upload fails (network, server error, etc.)
  3. Error message shown
  4. User must refresh page and start over
  5. All progress is lost

User Impact

  • Frustrating experience on flaky connections
  • Loss of form data if page is refreshed
  • No way to retry individual failed images
  • Must re-select all images

Proposed Solution

Add retry functionality to the upload UI:

// In imageUpload.pug script section
async function uploadFiles(files, retryCount = 0) {
  const MAX_RETRIES = 3;
  
  try {
    const response = await fetch('/api/upload/image', {
      method: 'POST',
      body: formData
    });
    
    if (\!response.ok && retryCount < MAX_RETRIES) {
      // Exponential backoff
      const delay = Math.pow(2, retryCount) * 1000;
      await new Promise(resolve => setTimeout(resolve, delay));
      
      // Retry
      return uploadFiles(files, retryCount + 1);
    }
    
    // ... handle success
  } catch (error) {
    if (retryCount < MAX_RETRIES) {
      // Show retry UI
      showRetryOption(files, retryCount);
    } else {
      showFinalError(error);
    }
  }
}

function showRetryOption(files, attemptNumber) {
  const retryButton = document.createElement('button');
  retryButton.textContent = `Retry Upload (Attempt ${attemptNumber + 1}/3)`;
  retryButton.onclick = () => uploadFiles(files, attemptNumber);
  
  document.getElementById('upload-errors').appendChild(retryButton);
}

UI Components Needed

  1. Retry button for failed uploads
  2. Progress indicator showing retry attempt
  3. Individual file retry (not just batch)
  4. Smart retry (only retry failed files)

Advanced Features

  • Store failed uploads in localStorage
  • Auto-retry on network recovery
  • Resume partial uploads
  • Show which files succeeded vs failed

Success Criteria

  • Users can retry failed uploads without losing data
  • Exponential backoff prevents server overload
  • Clear feedback on retry attempts
  • Graceful degradation after max retries

Testing

  • Simulate network failures
  • Test with flaky connection
  • Verify exponential backoff
  • Test max retry limit

Priority: Medium - Improves user experience significantly
Effort: Medium - Requires UI and JavaScript changes
Labels: enhancement, ui/ux

Activity

  1. added
    enhancementNew feature or request
    ui/uxUser interface and user experience improvements
    priority:mediumMedium priority - important but not urgent
    on Aug 11, 2025
  2. jra3 commented on Oct 7, 2025

    @jra3
    OwnerAuthor

    Consolidated into master issue #115. See #115 for comprehensive tracking of all image upload enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:mediumMedium priority - important but not urgentui/uxUser interface and user experience improvements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0