fix(android): the keyboard closes, and the write test is gone
Same origin as the sideways slide. The keyboard's validate key asks for the next field, and the next one in the document sits on a view parked outside the frame. Focus landed there unseen: the keyboard changed shape - numeric for the code, alphabetic for the search - and would not close, because the field holding it open was off screen. No field of a resting view keeps the focus now, and the validate key closes the keyboard instead of jumping. In the editor it saves, which is what the key is for after typing a password. The write test goes with it: it proved the write path before the first real PUT, that path now carries the vault itself, and the button, its handler, the probe and the debug hook that revealed it were only ever scaffolding.
This commit is contained in:
-65
@@ -196,7 +196,6 @@ type
|
||||
{$IFDEF DEBUG}
|
||||
procedure CryptoSelfCheck;
|
||||
procedure PatchSelfCheck;
|
||||
procedure WriteTest;
|
||||
{$ENDIF}
|
||||
procedure OpenEntry(AVaultIndex: Integer);
|
||||
procedure SaveEntryPassword(const ANewValue: string);
|
||||
@@ -302,7 +301,6 @@ begin
|
||||
ShowUnlock;
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
WebCall('PM.setDebug(true)');
|
||||
// VERIFICATION DU CHIFFREMENT AVANT TOUTE ECRITURE REELLE (§4). Elle depose
|
||||
// aussi un conteneur sur le disque prive, pour qu'il soit relu par l'AUTRE
|
||||
// implementation : un aller-retour avec soi-meme ne prouve que la coherence
|
||||
@@ -708,65 +706,6 @@ begin
|
||||
end).Start;
|
||||
end;
|
||||
|
||||
/// Essai du chemin d'ecriture, VERS UN AUTRE FICHIER que le coffre.
|
||||
///
|
||||
/// Le premier PUT est le moment ou une erreur de transport se paie en donnees
|
||||
/// perdues : un corps mal forme, un sha mal place, et vault-sync.json est
|
||||
/// remplace par quelque chose que personne ne sait relire. L'ecrire d'abord
|
||||
/// sous un autre nom prouve exactement les memes choses - enveloppe, jeton,
|
||||
/// droits, sha rendu - sans mettre le coffre en jeu une seule fois.
|
||||
procedure TForm8.WriteTest;
|
||||
var
|
||||
LUrl: string;
|
||||
begin
|
||||
if FBusy then Exit;
|
||||
SetBusy(True);
|
||||
// Meme depot, autre fichier : on remplace le dernier segment du chemin.
|
||||
LUrl := FUrl.Substring(0, FUrl.LastIndexOf('/') + 1) + 'write-test.json';
|
||||
TThread.CreateAnonymousThread(
|
||||
procedure
|
||||
var
|
||||
LClient: TSyncClient;
|
||||
LRes, LGet: TSyncResult;
|
||||
LBody, LSha: string;
|
||||
begin
|
||||
LClient := TSyncClient.Create(LUrl, FToken);
|
||||
try
|
||||
LBody := EncryptContainer(
|
||||
Format('{"probe":"write path","at":"%s"}',
|
||||
[FormatDateTime('yyyy-mm-dd"T"hh:nn:ss"Z"',
|
||||
TTimeZone.Local.ToUniversalTime(Now))]),
|
||||
FSyncPwd, 1000);
|
||||
// LIRE D'ABORD, ECRIRE ENSUITE - la sequence reelle. Un sha vide veut
|
||||
// dire « cree », et Gitea refuse alors en 422 si le fichier est deja
|
||||
// la ; c'est le cas de mise a jour qui compte, et il exige le sha
|
||||
// courant. Un 404 au GET signifie simplement qu'il n'existe pas
|
||||
// encore : on cree, sha vide.
|
||||
LGet := LClient.Fetch;
|
||||
if LGet.Status = ssOK then
|
||||
LSha := LGet.ETag
|
||||
else
|
||||
LSha := '';
|
||||
Log(Format('GET first: HTTP %d, sha %s', [LGet.HttpCode,
|
||||
IfThen(LSha = '', '(aucun - creation)', LSha)]));
|
||||
|
||||
Log('PUT ' + LUrl);
|
||||
Log(Format(' token %s (%d chars), body %d chars',
|
||||
[Fingerprint(FToken), Length(FToken), Length(LBody)]));
|
||||
LRes := LClient.Put(LBody, LSha, 'write path probe from phone');
|
||||
case LRes.Status of
|
||||
ssOK: Log(' OK ' + LRes.HttpCode.ToString + ' - new sha ' + LRes.ETag);
|
||||
ssConflict: Log(' 409 - file already there, concurrency control works');
|
||||
else
|
||||
Log(' failed: ' + LRes.HttpCode.ToString + ' ' + LRes.Error);
|
||||
end;
|
||||
finally
|
||||
LClient.Free;
|
||||
TThread.Queue(nil, procedure begin SetBusy(False); end);
|
||||
end;
|
||||
end).Start;
|
||||
end;
|
||||
|
||||
/// Descend les coordonnees du serveur dans les champs de la page.
|
||||
procedure TForm8.PushConfig;
|
||||
var
|
||||
@@ -896,10 +835,6 @@ begin
|
||||
// porte est detruite, et HandleWebCommand ne journalise que l'action.
|
||||
else if LAction = 'setpwd' then
|
||||
SaveEntryPassword(TNetEncoding.URL.Decode(Param('v')))
|
||||
{$IFDEF DEBUG}
|
||||
else if LAction = 'writetest' then
|
||||
WriteTest
|
||||
{$ENDIF}
|
||||
|
||||
else if LAction = 'copy' then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user