mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 00:47:00 +01:00
fix(core,gui,cli): a blocked sign-in no longer asks to update the app (B209)
Proton answers a sign-in it blocks for abuse or rate limits with code 2028 and the text "This version of the app is no longer supported". The SDK read 2028 as Unknown, so the app passed that text through and told users to update a current release (issues #28, #39). - deps: proton-sdk and proton-drive-rs 0.8.3, which name 2028 Blocked - core: error::sign_in_blocked detects it - gui: the login page says Proton is refusing sign-in for now and that waiting helps, translated in every catalog - cli: pdfs login adds the same hint to the error - cli: pdfs diagnose warns instead of failing when cache.db does not exist yet; the daemon creates it after the first sign-in - docs: BUGS.md B209, changelog, troubleshooting entry
This commit is contained in:
1 parent
2633b4ed72
commit
478a0e6cdd
17 files changed
+481
-310
No files matched your search
@@ -1867,7 +1867,22 @@ fn cmd_login(username: Option<String>, remember: bool) -> Result<()> {
|
||||
get_mailbox,
|
||||
get_hv,
|
||||
))
|
||||
.context("login failed")?;
|
||||
.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
|
||||
}
|
||||
})?;
|
||||
|
||||
// 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
|
||||
@@ -3396,12 +3411,25 @@ fn cmd_diagnose() -> Result<()> {
|
||||
}
|
||||
|
||||
let db_path = dirs.db_path();
|
||||
let db_size = std::fs::metadata(&db_path).map(|m| m.len()).unwrap_or(0);
|
||||
report.check(
|
||||
" database",
|
||||
db_path.is_file(),
|
||||
format!("{} ({})", db_path.display(), human_bytes(db_size)),
|
||||
);
|
||||
if db_path.exists() {
|
||||
let db_size = std::fs::metadata(&db_path).map(|m| m.len()).unwrap_or(0);
|
||||
report.check(
|
||||
" database",
|
||||
db_path.is_file(),
|
||||
format!("{} ({})", db_path.display(), human_bytes(db_size)),
|
||||
);
|
||||
} else {
|
||||
// The daemon creates it on its first start, which waits for a sign-in,
|
||||
// so a fresh install has none yet (issue #39 read this as the fault).
|
||||
report.finding(
|
||||
DiagnoseLevel::Warn,
|
||||
" database",
|
||||
format!(
|
||||
"{} not created yet (the daemon creates it on first start)",
|
||||
db_path.display()
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
println!("\nFUSE");
|
||||
let fuse = Path::new("/dev/fuse");
|
||||
|
||||
Reference in new issue
Block a user