From 4d9fd2c34ae195b22247a1df9b5832a924d45aef Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:01:18 +0100 Subject: [PATCH] fix(android): a failed save can no longer hang on "Saving..." The except only covered decryption and the patch. An exception from re-encryption or from the PUT skipped the block that restores the screen - and that block also held the message, so the failure was invisible as well as permanent: the row stayed on "Saving..." with nothing to explain it. Restoring the screen now lives in the finally, so it happens whatever the code above did. A catch-all around the body turns any unforeseen exception into a message and a log line, because a failure that says nothing is indistinguishable from slowness - which is exactly how this one was reported. Co-Authored-By: Claude Opus 5 --- mainApk.pas | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/mainApk.pas b/mainApk.pas index 1885f10..9ee6fb5 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -586,6 +586,7 @@ begin LClient := TSyncClient.Create(FUrl, FToken); LDone := False; LErr := ''; + try try for LAttempt := 1 to 3 do begin @@ -652,17 +653,32 @@ begin end else WebCall('PM.toast(' + JsArg('Not saved - ' + LErr) + ')'); - // LE DETAIL DOIT REVENIR, dans les deux cas. AdoptVault reconstruit - // la LISTE ; la ligne en cours d'edition restait telle quelle, donc - // le champ de saisie demeurait a l'ecran et rien ne disait si - // l'enregistrement avait abouti. On la redessine depuis le coffre : - // apres un succes elle porte la nouvelle valeur, apres un echec - // l'ancienne - ce qui se lit sans commentaire. - ReopenEntryByUuid(LUuid); end); + except + // FILET. Le rechiffrement et le PUT sont hors du try qui + // couvre le dechiffrement : une exception y sortait sans un mot, + // et l'echec devenait indiscernable d'une lenteur. + on E: Exception do + begin + LErr := E.ClassName + ': ' + E.Message; + Log('save FAILED: ' + LErr); + TThread.Queue(nil, procedure + begin WebCall('PM.toast(' + JsArg('Not saved - ' + LErr) + ')'); end); + end; + end; finally LClient.Free; - TThread.Queue(nil, procedure begin SetBusy(False); end); + // LA REMISE EN ETAT EST ICI, PAS DANS LE CHEMIN NOMINAL. Elle etait + // apres la boucle : une exception au rechiffrement ou au PUT la + // sautait, et la ligne restait sur « Saving... » pour toujours - sans + // message, puisque le message aussi etait dans la partie sautee. + // Quoi qu'il arrive au-dessus, l'ecran redevient utilisable. + TThread.Queue(nil, + procedure + begin + SetBusy(False); + ReopenEntryByUuid(LUuid); + end); end; end).Start; end;