Skip to content

fix : added request timeout to translateText - #2088

Merged
riteshbonthalakoti merged 1 commit into
riteshbonthalakoti:gssocfrom
tmdeveloper007:#2061
Jun 7, 2026
Merged

fix : added request timeout to translateText#2088
riteshbonthalakoti merged 1 commit into
riteshbonthalakoti:gssocfrom
tmdeveloper007:#2061

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Closes #2061.

Summary of What Has Been Done:
Added an AbortController with 10-second timeout to the translateText function.

Changes Made:

  • Wrap fetch call with AbortController
  • 10000ms timeout triggers abort
  • clearTimeout called in both success and error paths
  • AbortError is caught separately and logs a warning (not error)
  • Returns original text on timeout (same graceful fallback)
  • Added test verifying AbortController is passed to fetch

Impact it Made:

  • Prevents indefinite hangs during network issues
  • Improves UX when MyMemory API is slow or unavailable
  • All 8 tests pass

test: add AbortController timeout test to translationService
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tmdeveloper007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 31 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b99dd82-e0a0-407a-94ae-85b88c4948d8

📥 Commits

Reviewing files that changed from the base of the PR and between da8faf2 and 56b12bf.

📒 Files selected for processing (2)
  • Frontend/src/services/translationService.js
  • Frontend/src/services/translationService.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@riteshbonthalakoti
riteshbonthalakoti changed the base branch from main to gssoc June 7, 2026 16:01
@riteshbonthalakoti

Copy link
Copy Markdown
Owner

Superb implementation, @tmdeveloper007! I've successfully resolved all conflicts in your PR and queued it for merging into gssoc.

⚠️ MANDATORY STEPS FOR LEADERBOARD CREDITS:
To ensure you receive full points, please make sure you have taken 10 seconds to:

Keep up the outstanding work! Let's build together! 🔥

@riteshbonthalakoti
riteshbonthalakoti merged commit 6bbd9d8 into riteshbonthalakoti:gssoc Jun 7, 2026
9 of 10 checks passed
@tmdeveloper007

Copy link
Copy Markdown
Author

Hi @ritesh-1918, this PR was merged but does not have GSSoC labels applied. Could you please add the appropriate labels (e.g. gssoc, gssoc:approved, level:beginner/level:advanced, type:testing/type:bug/type:docs etc.) so the contribution is properly tracked for GSSoC? Thank you!

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.

fix : add request timeout to translateText

2 participants