From 094a58490f05205a1def8d992672c1deb51a14a8 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 4 Dec 2023 15:27:48 -0600 Subject: [PATCH] Handle feedgen 429 (#2066) * Handle feedgen 429 * Translate --- src/locale/locales/cs/messages.po | 20 ++++++++++++-------- src/locale/locales/en/messages.po | 20 ++++++++++++-------- src/locale/locales/es/messages.po | 20 ++++++++++++-------- src/locale/locales/fr/messages.po | 20 ++++++++++++-------- src/locale/locales/hi/messages.po | 20 ++++++++++++-------- src/view/com/posts/FeedErrorMessage.tsx | 11 +++++++++++ 6 files changed, 71 insertions(+), 40 deletions(-) diff --git a/src/locale/locales/cs/messages.po b/src/locale/locales/cs/messages.po index 6cd60a88..f86a05ce 100644 --- a/src/locale/locales/cs/messages.po +++ b/src/locale/locales/cs/messages.po @@ -920,23 +920,23 @@ msgstr "" msgid "Hide user list" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:101 +#: src/view/com/posts/FeedErrorMessage.tsx:102 msgid "Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:89 +#: src/view/com/posts/FeedErrorMessage.tsx:90 msgid "Hmm, the feed server appears to be misconfigured. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:95 +#: src/view/com/posts/FeedErrorMessage.tsx:96 msgid "Hmm, the feed server appears to be offline. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:92 +#: src/view/com/posts/FeedErrorMessage.tsx:93 msgid "Hmm, the feed server gave a bad response. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:86 +#: src/view/com/posts/FeedErrorMessage.tsx:87 msgid "Hmmm, we're having trouble finding this feed. It may have been deleted." msgstr "" @@ -1527,7 +1527,7 @@ msgstr "" msgid "Remove account" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:118 +#: src/view/com/posts/FeedErrorMessage.tsx:122 msgid "Remove feed" msgstr "" @@ -1544,7 +1544,7 @@ msgstr "" msgid "Remove image preview" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:119 +#: src/view/com/posts/FeedErrorMessage.tsx:123 msgid "Remove this feed from your saved feeds?" msgstr "" @@ -2145,10 +2145,14 @@ msgstr "" msgid "We're so excited to have you join us!" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:98 +#: src/view/com/posts/FeedErrorMessage.tsx:99 msgid "We're sorry, but this content is not viewable without a Bluesky account." msgstr "" +#: src/view/com/posts/FeedErrorMessage.tsx:105 +msgid "We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later." +msgstr "" + #: src/view/screens/Search/Search.tsx:236 msgid "We're sorry, but your search could not be completed. Please try again in a few minutes." msgstr "" diff --git a/src/locale/locales/en/messages.po b/src/locale/locales/en/messages.po index 5e0aec46..633a5d21 100644 --- a/src/locale/locales/en/messages.po +++ b/src/locale/locales/en/messages.po @@ -920,23 +920,23 @@ msgstr "" msgid "Hide user list" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:101 +#: src/view/com/posts/FeedErrorMessage.tsx:102 msgid "Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:89 +#: src/view/com/posts/FeedErrorMessage.tsx:90 msgid "Hmm, the feed server appears to be misconfigured. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:95 +#: src/view/com/posts/FeedErrorMessage.tsx:96 msgid "Hmm, the feed server appears to be offline. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:92 +#: src/view/com/posts/FeedErrorMessage.tsx:93 msgid "Hmm, the feed server gave a bad response. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:86 +#: src/view/com/posts/FeedErrorMessage.tsx:87 msgid "Hmmm, we're having trouble finding this feed. It may have been deleted." msgstr "" @@ -1527,7 +1527,7 @@ msgstr "" msgid "Remove account" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:118 +#: src/view/com/posts/FeedErrorMessage.tsx:122 msgid "Remove feed" msgstr "" @@ -1544,7 +1544,7 @@ msgstr "" msgid "Remove image preview" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:119 +#: src/view/com/posts/FeedErrorMessage.tsx:123 msgid "Remove this feed from your saved feeds?" msgstr "" @@ -2145,10 +2145,14 @@ msgstr "" msgid "We're so excited to have you join us!" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:98 +#: src/view/com/posts/FeedErrorMessage.tsx:99 msgid "We're sorry, but this content is not viewable without a Bluesky account." msgstr "" +#: src/view/com/posts/FeedErrorMessage.tsx:105 +msgid "We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later." +msgstr "" + #: src/view/screens/Search/Search.tsx:236 msgid "We're sorry, but your search could not be completed. Please try again in a few minutes." msgstr "" diff --git a/src/locale/locales/es/messages.po b/src/locale/locales/es/messages.po index baab22c7..acd9a4a3 100644 --- a/src/locale/locales/es/messages.po +++ b/src/locale/locales/es/messages.po @@ -920,23 +920,23 @@ msgstr "" msgid "Hide user list" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:101 +#: src/view/com/posts/FeedErrorMessage.tsx:102 msgid "Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:89 +#: src/view/com/posts/FeedErrorMessage.tsx:90 msgid "Hmm, the feed server appears to be misconfigured. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:95 +#: src/view/com/posts/FeedErrorMessage.tsx:96 msgid "Hmm, the feed server appears to be offline. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:92 +#: src/view/com/posts/FeedErrorMessage.tsx:93 msgid "Hmm, the feed server gave a bad response. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:86 +#: src/view/com/posts/FeedErrorMessage.tsx:87 msgid "Hmmm, we're having trouble finding this feed. It may have been deleted." msgstr "" @@ -1527,7 +1527,7 @@ msgstr "" msgid "Remove account" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:118 +#: src/view/com/posts/FeedErrorMessage.tsx:122 msgid "Remove feed" msgstr "" @@ -1544,7 +1544,7 @@ msgstr "" msgid "Remove image preview" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:119 +#: src/view/com/posts/FeedErrorMessage.tsx:123 msgid "Remove this feed from your saved feeds?" msgstr "" @@ -2145,10 +2145,14 @@ msgstr "" msgid "We're so excited to have you join us!" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:98 +#: src/view/com/posts/FeedErrorMessage.tsx:99 msgid "We're sorry, but this content is not viewable without a Bluesky account." msgstr "" +#: src/view/com/posts/FeedErrorMessage.tsx:105 +msgid "We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later." +msgstr "" + #: src/view/screens/Search/Search.tsx:236 msgid "We're sorry, but your search could not be completed. Please try again in a few minutes." msgstr "" diff --git a/src/locale/locales/fr/messages.po b/src/locale/locales/fr/messages.po index 95b10a09..8fa5531d 100644 --- a/src/locale/locales/fr/messages.po +++ b/src/locale/locales/fr/messages.po @@ -920,23 +920,23 @@ msgstr "" msgid "Hide user list" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:101 +#: src/view/com/posts/FeedErrorMessage.tsx:102 msgid "Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:89 +#: src/view/com/posts/FeedErrorMessage.tsx:90 msgid "Hmm, the feed server appears to be misconfigured. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:95 +#: src/view/com/posts/FeedErrorMessage.tsx:96 msgid "Hmm, the feed server appears to be offline. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:92 +#: src/view/com/posts/FeedErrorMessage.tsx:93 msgid "Hmm, the feed server gave a bad response. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:86 +#: src/view/com/posts/FeedErrorMessage.tsx:87 msgid "Hmmm, we're having trouble finding this feed. It may have been deleted." msgstr "" @@ -1527,7 +1527,7 @@ msgstr "" msgid "Remove account" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:118 +#: src/view/com/posts/FeedErrorMessage.tsx:122 msgid "Remove feed" msgstr "" @@ -1544,7 +1544,7 @@ msgstr "" msgid "Remove image preview" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:119 +#: src/view/com/posts/FeedErrorMessage.tsx:123 msgid "Remove this feed from your saved feeds?" msgstr "" @@ -2145,10 +2145,14 @@ msgstr "" msgid "We're so excited to have you join us!" msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:98 +#: src/view/com/posts/FeedErrorMessage.tsx:99 msgid "We're sorry, but this content is not viewable without a Bluesky account." msgstr "" +#: src/view/com/posts/FeedErrorMessage.tsx:105 +msgid "We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later." +msgstr "" + #: src/view/screens/Search/Search.tsx:236 msgid "We're sorry, but your search could not be completed. Please try again in a few minutes." msgstr "" diff --git a/src/locale/locales/hi/messages.po b/src/locale/locales/hi/messages.po index e442483d..39e95ffc 100644 --- a/src/locale/locales/hi/messages.po +++ b/src/locale/locales/hi/messages.po @@ -912,23 +912,23 @@ msgstr "इसे छिपाएं" msgid "Hide user list" msgstr "उपयोगकर्ता सूची छुपाएँ" -#: src/view/com/posts/FeedErrorMessage.tsx:101 +#: src/view/com/posts/FeedErrorMessage.tsx:102 msgid "Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:89 +#: src/view/com/posts/FeedErrorMessage.tsx:90 msgid "Hmm, the feed server appears to be misconfigured. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:95 +#: src/view/com/posts/FeedErrorMessage.tsx:96 msgid "Hmm, the feed server appears to be offline. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:92 +#: src/view/com/posts/FeedErrorMessage.tsx:93 msgid "Hmm, the feed server gave a bad response. Please let the feed owner know about this issue." msgstr "" -#: src/view/com/posts/FeedErrorMessage.tsx:86 +#: src/view/com/posts/FeedErrorMessage.tsx:87 msgid "Hmmm, we're having trouble finding this feed. It may have been deleted." msgstr "" @@ -1519,7 +1519,7 @@ msgstr "मेरे फ़ीड से {0} हटाएं?" msgid "Remove account" msgstr "खाता हटाएं" -#: src/view/com/posts/FeedErrorMessage.tsx:118 +#: src/view/com/posts/FeedErrorMessage.tsx:122 msgid "Remove feed" msgstr "फ़ीड हटाएँ" @@ -1536,7 +1536,7 @@ msgstr "छवि निकालें" msgid "Remove image preview" msgstr "छवि पूर्वावलोकन निकालें" -#: src/view/com/posts/FeedErrorMessage.tsx:119 +#: src/view/com/posts/FeedErrorMessage.tsx:123 msgid "Remove this feed from your saved feeds?" msgstr "इस फ़ीड को सहेजे गए फ़ीड से हटा दें?" @@ -2137,10 +2137,14 @@ msgstr "साइट पर जाएं" msgid "We're so excited to have you join us!" msgstr "हम आपके हमारी सेवा में शामिल होने को लेकर बहुत उत्साहित हैं!" -#: src/view/com/posts/FeedErrorMessage.tsx:98 +#: src/view/com/posts/FeedErrorMessage.tsx:99 msgid "We're sorry, but this content is not viewable without a Bluesky account." msgstr "" +#: src/view/com/posts/FeedErrorMessage.tsx:105 +msgid "We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later." +msgstr "" + #: src/view/screens/Search/Search.tsx:236 msgid "We're sorry, but your search could not be completed. Please try again in a few minutes." msgstr "" diff --git a/src/view/com/posts/FeedErrorMessage.tsx b/src/view/com/posts/FeedErrorMessage.tsx index 63d9d595..f63bc1a8 100644 --- a/src/view/com/posts/FeedErrorMessage.tsx +++ b/src/view/com/posts/FeedErrorMessage.tsx @@ -25,6 +25,7 @@ export enum KnownError { FeedgenOffline = 'FeedgenOffline', FeedgenUnknown = 'FeedgenUnknown', FeedNSFPublic = 'FeedNSFPublic', + FeedTooManyRequests = 'FeedTooManyRequests', Unknown = 'Unknown', } @@ -100,6 +101,9 @@ function FeedgenErrorMessage({ [KnownError.FeedgenUnknown]: _l( msgLingui`Hmm, some kind of issue occured when contacting the feed server. Please let the feed owner know about this issue.`, ), + [KnownError.FeedTooManyRequests]: _l( + msgLingui`We're sorry, but this feed is currently receiving high traffic and is temporarily unavailable. Please try again later.`, + ), }[knownError]), [_l, knownError], ) @@ -203,6 +207,13 @@ function detectKnownError( ) { return KnownError.Block } + + // check status codes + if (error?.status === 429) { + return KnownError.FeedTooManyRequests + } + + // convert error to string and continue if (typeof error !== 'string') { error = error.toString() }