fix(android): a conflict answers 422, not 409
The retry path finally ran, and did not recognise what it was handed. A desktop publishing between our read and our write earns a 422, not a 409, so the save failed instead of retrying - which is exactly what a never-exercised path hides: it was written, it compiled, it was even commented, and it did not fire. Gitea answers 409 when the sha no longer matches and 422 when it is missing or the request is judged unprocessable, "file already exists" among them. Both say the same thing to us: the sha is stale. Re-reading and retrying is right for both and cannot clobber anything - the retry publishes against the fresh sha. A genuinely malformed body would fail again and give up after three tries, carrying Gitea's own words. The log now prints which code it was, rather than assuming.
This commit is contained in:
+2
-1
@@ -832,7 +832,8 @@ begin
|
||||
|
||||
if LPut.Status = ssConflict then
|
||||
begin
|
||||
Log('save: 409 - another device published, re-reading');
|
||||
Log(Format('save: %d - another device published, re-reading',
|
||||
[LPut.HttpCode]));
|
||||
LPlain := '';
|
||||
Continue;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user