mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-25 18:43:32 +01:00
Merge pull request #128 from narrrl/fix/sign-in-block
fix(auth): clarify blocked sign-in without upgrade advice
This commit is contained in:
14 files changed
+124
-84
No files matched your search
+32
-16
@@ -2273,22 +2273,7 @@ fn cmd_login(username: Option<String>, remember: bool) -> Result<()> {
|
||||
get_mailbox,
|
||||
get_hv,
|
||||
))
|
||||
.map_err(|e| {
|
||||
// Proton words this block as "update the app", which the user can't
|
||||
// act on: the release is current and only waiting helps.
|
||||
let blocked =
|
||||
matches!(&e, pdfs_core::Error::Proton(p) if pdfs_core::error::sign_in_blocked(p));
|
||||
let e = anyhow::Error::new(e).context("login failed");
|
||||
if blocked {
|
||||
e.context(
|
||||
"Proton is temporarily refusing sign-in from this device (code 2028). \
|
||||
Your version is not the problem. Wait several hours, up to a day, \
|
||||
without trying again, then sign in.",
|
||||
)
|
||||
} else {
|
||||
e
|
||||
}
|
||||
})?;
|
||||
.map_err(login_failure)?;
|
||||
|
||||
// A daemon that is already up is parked in `wait_for_session`, sleeping
|
||||
// between keyring checks; restart it so the mount appears now instead of
|
||||
@@ -2304,6 +2289,18 @@ fn cmd_login(username: Option<String>, remember: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn login_failure(error: pdfs_core::Error) -> anyhow::Error {
|
||||
if matches!(&error, pdfs_core::Error::Proton(e) if pdfs_core::error::sign_in_blocked(e)) {
|
||||
// The SDK logs the response code at debug level. Its server text
|
||||
// would give contradictory instructions in the displayed cause chain.
|
||||
anyhow::anyhow!(
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it persists, try signing in on the web and mention code 2028 when contacting Proton support."
|
||||
)
|
||||
} else {
|
||||
anyhow::Error::new(error).context("login failed")
|
||||
}
|
||||
}
|
||||
|
||||
/// Ask for the mailbox password of a two-password account, without echo.
|
||||
fn prompt_mailbox(attempt: u32, remember: bool) -> pdfs_core::Result<auth::Mailbox> {
|
||||
if attempt == 0 {
|
||||
@@ -4884,6 +4881,25 @@ mod diagnose_tests {
|
||||
mod login_wait_tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn login_failure_preserves_only_actionable_upgrade_advice() {
|
||||
use pdfs_core::proton_sdk::{ProtonApiError, ProtonError, api::ResponseCode};
|
||||
for (code, blocked) in [
|
||||
(ResponseCode::Blocked, true),
|
||||
(ResponseCode::OutdatedApp, false),
|
||||
] {
|
||||
let error = ProtonError::Api(ProtonApiError {
|
||||
code,
|
||||
http_status: 422,
|
||||
message: "Please update the app".into(),
|
||||
details: None,
|
||||
});
|
||||
let rendered = format!("{:#}", login_failure(error.into()));
|
||||
assert_eq!(rendered.contains("2028"), blocked);
|
||||
assert_eq!(rendered.contains("Please update"), !blocked);
|
||||
}
|
||||
}
|
||||
|
||||
/// The mount retry backs off from 5 s to a ceiling of minutes, rather than
|
||||
/// asking Proton every 5 s forever (`docs/BUGS.md` B263).
|
||||
#[test]
|
||||
|
||||
@@ -316,7 +316,7 @@ pub(crate) fn login_error_message(error: &pdfs_core::Error) -> String {
|
||||
// Proton's text for this one asks the user to update an app that is
|
||||
// already current.
|
||||
pdfs_core::Error::Proton(e) if pdfs_core::error::sign_in_blocked(e) => gettext(
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is not the problem. Wait several hours, up to a day, without trying again, then sign in.",
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it persists, try signing in on the web and mention code 2028 when contacting Proton support.",
|
||||
),
|
||||
pdfs_core::Error::Proton(ProtonError::Api(api)) if !api.message.is_empty() => {
|
||||
api.message.clone()
|
||||
@@ -770,10 +770,31 @@ mod tests {
|
||||
details: None,
|
||||
}));
|
||||
let message = login_error_message(&error);
|
||||
assert!(message.contains("temporarily refusing"), "{message}");
|
||||
assert!(message.contains("code 2028"), "{message}");
|
||||
assert!(!message.contains("update"), "{message}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn outdated_clients_and_rate_limits_keep_their_own_guidance() {
|
||||
use pdfs_core::proton_sdk::{ProtonApiError, ProtonError, api::ResponseCode};
|
||||
for (code, status, expected) in [
|
||||
(ResponseCode::OutdatedApp, 422, "Please update the app"),
|
||||
(
|
||||
ResponseCode::TooManyRequests,
|
||||
429,
|
||||
"Too many sign-in attempts",
|
||||
),
|
||||
] {
|
||||
let error = ProtonError::Api(ProtonApiError {
|
||||
code,
|
||||
http_status: status,
|
||||
message: "Please update the app".into(),
|
||||
details: None,
|
||||
});
|
||||
assert!(login_error_message(&error.into()).contains(expected));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_unmapped_error_keeps_its_text() {
|
||||
let error = pdfs_core::Error::Other("something odd".into());
|
||||
|
||||
@@ -11,6 +11,8 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Sign-in failures with Proton code 2028 now give consistent recovery guidance in the desktop app and CLI (#39).
|
||||
|
||||
## [3.10.0] — 2026-11-22
|
||||
|
||||
Schema: **47**. The trash table gets an index on the original folder, and its stored rows are
|
||||
|
||||
@@ -100,14 +100,14 @@ The page then runs without WebKit's isolation, so use this only for the sign-in.
|
||||
session keeps working without it. Signing in from your usual network, without a VPN, often avoids
|
||||
the CAPTCHA in the first place.
|
||||
|
||||
### "This version of the app is no longer supported" or "Proton is temporarily refusing sign-in from this device"
|
||||
### "This version of the app is no longer supported" or sign-in code 2028
|
||||
|
||||
Proton blocks sign-in for a while after too many attempts, or from a network it distrusts. It sends
|
||||
the first message even when your version is current. Do not retry for several hours, up to a day,
|
||||
then sign in once.
|
||||
For code 2028, pause before trying again. Proton does not give the client an expiry time.
|
||||
If the block persists, check whether you can sign in at [Drive on the web](https://drive.proton.me)
|
||||
and mention the code, client version and web sign-in result when contacting Proton support.
|
||||
|
||||
If it still fails, run `RUST_LOG=debug pdfs login` and look for `code=` in the
|
||||
`proton api request failed` line. 2028 is this block; 5003 is a release Proton no longer accepts.
|
||||
If an older client only says to update, look for the `proton api request failed` line in
|
||||
`RUST_LOG=debug pdfs login`. Code 5003 means Proton no longer accepts that app version.
|
||||
|
||||
### Sign-in works but is forgotten after a restart
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: German\n"
|
||||
@@ -3711,13 +3711,13 @@ msgstr "Zu viele Anmeldeversuche. Einige Minuten warten und erneut versuchen."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton lehnt Anmeldungen von diesem Gerät vorübergehend ab. Die App-Version "
|
||||
"ist nicht das Problem. Einige Stunden, bis zu einem Tag, warten, ohne es "
|
||||
"erneut zu versuchen, dann anmelden."
|
||||
"Proton hat diese Anmeldung abgelehnt (Code 2028). Vor einem erneuten Versuch "
|
||||
"warten. Bleibt das Problem bestehen, die Anmeldung im Browser versuchen und "
|
||||
"dem Proton-Support den Code 2028 nennen."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
+7
-7
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: English (United Kingdom)\n"
|
||||
@@ -3653,13 +3653,13 @@ msgstr "Too many sign-in attempts. Wait a few minutes and try again."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: Spanish\n"
|
||||
@@ -3686,13 +3686,13 @@ msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton rechaza temporalmente el inicio de sesión desde este dispositivo. La "
|
||||
"versión de la aplicación no es el problema. Espere varias horas, hasta un "
|
||||
"día, sin volver a intentarlo y luego inicie sesión."
|
||||
"Proton ha rechazado este inicio de sesión (código 2028). Espera antes de "
|
||||
"volver a intentarlo. Si el problema persiste, prueba a iniciar sesión en la "
|
||||
"web y menciona el código 2028 al contactar con el soporte de Proton."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: French\n"
|
||||
@@ -3711,13 +3711,13 @@ msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton refuse temporairement la connexion depuis cet appareil. La version de "
|
||||
"l’application n’est pas en cause. Patientez plusieurs heures, jusqu’à un "
|
||||
"jour, sans réessayer, puis connectez-vous."
|
||||
"Proton a refusé cette connexion (code 2028). Patientez avant de réessayer. "
|
||||
"Si le problème persiste, essayez de vous connecter sur le Web et indiquez le "
|
||||
"code 2028 à l’assistance Proton."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: Italian\n"
|
||||
@@ -3699,13 +3699,13 @@ msgstr "Troppi tentativi di accesso. Attendi qualche minuto e riprova."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton sta rifiutando temporaneamente l'accesso da questo dispositivo. La "
|
||||
"versione dell'app non è il problema. Attendi alcune ore, fino a un giorno, "
|
||||
"senza riprovare, poi accedi."
|
||||
"Proton ha rifiutato questo accesso (codice 2028). Attendi prima di "
|
||||
"riprovare. Se il problema persiste, prova ad accedere dal web e indica il "
|
||||
"codice 2028 quando contatti l’assistenza Proton."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: Dutch\n"
|
||||
@@ -3695,13 +3695,14 @@ msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton weigert tijdelijk aanmeldingen vanaf dit apparaat. Je app-versie is "
|
||||
"niet het probleem. Wacht enkele uren, tot een dag, zonder het opnieuw te "
|
||||
"proberen en meld je daarna aan."
|
||||
"Proton heeft deze aanmelding geweigerd (code 2028). Wacht voordat je het "
|
||||
"opnieuw probeert. Blijft het probleem bestaan, probeer dan via de website in "
|
||||
"te loggen en vermeld code 2028 wanneer je contact opneemt met Proton-"
|
||||
"ondersteuning."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 3.10.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -3529,9 +3529,9 @@ msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: Polish\n"
|
||||
@@ -3763,13 +3763,13 @@ msgstr ""
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"Proton tymczasowo odrzuca logowanie z tego urządzenia. Wersja aplikacji nie "
|
||||
"jest problemem. Proszę odczekać kilka godzin, maksymalnie dobę, bez "
|
||||
"ponownych prób, a następnie się zalogować."
|
||||
"Proton odrzucił tę próbę logowania (kod 2028). Poczekaj przed kolejną próbą. "
|
||||
"Jeśli problem nie ustąpi, spróbuj zalogować się przez przeglądarkę i podaj "
|
||||
"kod 2028 podczas kontaktu z pomocą techniczną Proton."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
+7
-7
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: proton-drive-linux 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
|
||||
"POT-Creation-Date: 2026-11-22 02:24+0100\n"
|
||||
"POT-Creation-Date: 2026-11-24 21:18+0100\n"
|
||||
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
|
||||
"Last-Translator: Proton Drive for Linux contributors\n"
|
||||
"Language-Team: Portuguese (Brazil)\n"
|
||||
@@ -3685,13 +3685,13 @@ msgstr "Muitas tentativas de entrar. Aguarde alguns minutos e tente novamente."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:319
|
||||
msgid ""
|
||||
"Proton is temporarily refusing sign-in from this device. Your app version is "
|
||||
"not the problem. Wait several hours, up to a day, without trying again, then "
|
||||
"sign in."
|
||||
"Proton declined this sign-in (code 2028). Wait before trying again. If it "
|
||||
"persists, try signing in on the web and mention code 2028 when contacting "
|
||||
"Proton support."
|
||||
msgstr ""
|
||||
"O Proton está recusando temporariamente a entrada a partir deste "
|
||||
"dispositivo. A versão do app não é o problema. Aguarde algumas horas, até um "
|
||||
"dia, sem tentar novamente e depois entre."
|
||||
"O Proton recusou este login (código 2028). Aguarde antes de tentar "
|
||||
"novamente. Se o problema persistir, tente entrar pela web e informe o código "
|
||||
"2028 ao contatar o suporte do Proton."
|
||||
|
||||
#: crates/pdfs-gui/src/app/pages/login.rs:325
|
||||
msgid "Couldn't reach Proton. Check your internet connection and try again."
|
||||
|
||||
Reference in new issue
Block a user