-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RNMobile] Avoid "429 - Too Many Request" error when fetching translations #51103
[RNMobile] Avoid "429 - Too Many Request" error when fetching translations #51103
Conversation
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
Flaky tests detected in dafdad0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5123638761
|
I noticed when testing that requests to the language URL were being redirected. For this reason, the URL has been updated to avoid this redirection.
const getLanguageUrl = ( locale, projectSlug ) => | ||
`https://translate.wordpress.org/projects/${ projectSlug }/dev/${ locale }/default/export-translations\?format\=json`; | ||
`https://translate.wordpress.org/projects/${ projectSlug }/dev/${ locale }/default/export-translations/\?format\=json`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed when testing that requests to the language URL were being redirected. For this reason, the URL has been updated to avoid this redirection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice improvement!
I ran it a few times and checked the files are being generated.
I also encountered the 429 - Too Many Requests
error and the script successfully retried it without any issues. 🚀
…tions (WordPress#51103) * Fetch translations in batches * Abort fetch translations process upon failure * Avoid parsing response if translation request failed * Retry translation download when getting error 429 * Revert fetch translations in batches * Fix language URL I noticed when testing that requests to the language URL were being redirected. For this reason, the URL has been updated to avoid this redirection.
Related PRs:
bundle:js
command is not executed ifclean
fails wordpress-mobile/gutenberg-mobile#5820What?
Update the script for downloading the translations to avoid the "429 - Too Many Request" error.
Why?
I recently experienced errors when downloading translations as part of React Native bundle generation. We need to ensure that translations are downloaded to include them in the bundle.
How?
Testing Instructions
npm run native i18n:fetch-translations
multiple times. This can be tested with the following command:Translation file <URL> for project slug wp-plugins/gutenberg failed with error 429 - Too Many Requests, retrying (5)...
.packages/react-native-editor/i18n-cache/gutenberg/data
.Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A