fix #14740: linux update check and upload safety
- Linux: ask the feed for the windows-x86_64 entry only to learn the version; report it (the settings show the .deb hint) without storing a pending update or announcing it. install_update refuses off Windows. - Background checks re-check is_due once the running lock is held. - Check errors read "Update-Prüfung fehlgeschlagen: …". - Settings: a failed follow-up getUpdate() never hides a found update; an unknown canSelfUpdate() shows it without an install button. - An upload the CRM accepted but that could not be saved locally names the CRM id and is refused for re-upload until the app restarts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -235,7 +235,22 @@ async fn upload(app: &AppHandle, state: &AppState, id: CallId) -> CmdResult<()>
|
||||
.await
|
||||
.inspect_err(|e| log::warn!("call {id}: upload failed: {e}"))?;
|
||||
log::info!("call {id}: transcript uploaded (CRM id {crm_id})");
|
||||
state.mark_uploaded(id, &crm_id)
|
||||
if let Err(e) = state.mark_uploaded(id, &crm_id) {
|
||||
// The CRM already has it: a retry must never send it again, even
|
||||
// though the row itself still shows no crm_transcript_id.
|
||||
state.note_upload_confirmed_but_unsaved(id);
|
||||
log::error!("call {id}: uploaded (CRM id {crm_id}) but could not save locally: {e}");
|
||||
return Err(unsaved_upload_message(&crm_id, &e));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Message for an upload that reached the CRM (`crm_id`) but whose local
|
||||
/// record (`mark_uploaded`) failed with `e`: names the CRM id so the user
|
||||
/// can find it there, and says plainly not to upload the call again (the
|
||||
/// app also refuses on its own, see `AppState::note_upload_confirmed_but_unsaved`).
|
||||
fn unsaved_upload_message(crm_id: &str, e: &str) -> String {
|
||||
format!("Hochgeladen (ID {crm_id}), aber lokal nicht gespeichert: {e} – nicht erneut hochladen")
|
||||
}
|
||||
|
||||
/// [`Login`] through the login window, for the upload.
|
||||
@@ -448,6 +463,14 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_unsaved_upload_message_names_the_crm_id_and_warns_against_retrying() {
|
||||
assert_eq!(
|
||||
unsaved_upload_message("4711", "disk full"),
|
||||
"Hochgeladen (ID 4711), aber lokal nicht gespeichert: disk full – nicht erneut hochladen"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn everyone_waiting_gets_the_one_login_result() {
|
||||
let waiters = LoginWaiters::default();
|
||||
|
||||
Reference in New Issue
Block a user