Skip to content

feat: frontend auto-retry on network errors#10

Merged
BH3GEI merged 1 commit into
mainfrom
feat/10-auto-retry
May 21, 2026
Merged

feat: frontend auto-retry on network errors#10
BH3GEI merged 1 commit into
mainfrom
feat/10-auto-retry

Conversation

@BH3GEI

@BH3GEI BH3GEI commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Add fetchWithRetry() helper that catches network errors (TypeError) and retries once after 2 seconds
  • Shows toast "网络波动,正在重试..." during retry wait
  • Applied to generate(), loadAvatars(), and loadCategories() fetch calls
  • Bumps asset version to v=15

Test plan

  • Verify fetchWithRetry function exists in deployed JS
  • Normal operation unaffected (no retry on successful requests)
  • HTTP errors (4xx/5xx) are NOT retried, only network errors

Wrap fetch calls in generate(), loadAvatars(), and loadCategories()
with a retry helper that catches TypeError (network errors) and
retries once after 2 seconds with a toast notification.
Bumps asset version to v=15.
Copilot AI review requested due to automatic review settings May 21, 2026 16:57
@BH3GEI BH3GEI merged commit e8ce9fd into main May 21, 2026
1 check failed
@BH3GEI BH3GEI removed the request for review from Copilot May 21, 2026 17:18
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.

1 participant