Skip to content

Fix API error handling and improve caching#161

Merged
theunavailableguy merged 3 commits into
masterfrom
fix/api-error-handling
Jul 13, 2026
Merged

Fix API error handling and improve caching#161
theunavailableguy merged 3 commits into
masterfrom
fix/api-error-handling

Conversation

@AIEraDev

Copy link
Copy Markdown
Owner

Changes

Error Handling Improvements

  • Added comprehensive error handling and logging to all API clients (transitions, filters, stickers, audio, text effects, video effects)
  • Include HTTP status codes and full error text in error messages
  • Log API key configuration status on module load (warn if missing, confirm if present)
  • Add try-catch blocks with proper error propagation
  • Log successful API responses with item counts for better debugging

Performance Improvements

  • Removed cache: 'reload' from all API fetch calls to enable browser caching
  • This reduces unnecessary network requests and improves performance for frequently accessed resources

Problem

Users were experiencing "Failed to load transitions" errors in v1.1.0. The API itself is working correctly (confirmed via Cloudflare logs showing 200 status), but error messages were generic and didn't provide enough debugging information.

Solution

This PR adds detailed logging at multiple levels:

  1. Module load: Log whether API key is configured
  2. Request level: Log each API request attempt
  3. Success: Log successful responses with data counts
  4. Failure: Log detailed error information including status codes and response text

This will help diagnose whether the issue is:

  • Missing/invalid API key in the build
  • Network connectivity problems
  • CORS issues
  • API endpoint changes

Testing

  • ✅ Build passes successfully
  • ✅ All API clients updated consistently
  • ✅ Error handling tested with try-catch blocks

Related Issues

Addresses the "Failed to load transitions" error reported in v1.1.0

cc @AIEraDev

AIEraDev added 3 commits July 13, 2026 18:53
- Added mp4-muxer for WebCodecs mobile export
- Required for MobileExportEncoder to create MP4 containers
- Fixes build failure in GitHub Actions
- Add detailed error logging to transitions, filters, stickers, audio, text effects, and video effects API clients
- Log API key configuration status on module load (warn if missing, confirm if present)
- Include HTTP status codes and error text in all error messages
- Add try-catch blocks with proper error propagation
- Log successful API responses with item counts for better debugging
- This will help diagnose the 'Failed to load transitions' error users are experiencing in v1.1.0
…ching

- Remove cache: 'reload' from all fetch calls in API clients
- This enables browser caching for API responses, improving performance
- Reduces unnecessary network requests for frequently accessed resources
- Applies to transitions, filters, stickers, audio, text effects, and video effects APIs
@theunavailableguy
theunavailableguy merged commit 6a2eb44 into master Jul 13, 2026
2 checks passed
@theunavailableguy
theunavailableguy deleted the fix/api-error-handling branch July 13, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants