From 5afaf7cbafb381a7044306cde13ab441ea2a6294 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 27 May 2025 20:54:58 +1000 Subject: [PATCH 1/5] feat(windows): human text message for 413 error --- windows/src/engine/tsysinfo/UfrmEmail.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/windows/src/engine/tsysinfo/UfrmEmail.pas b/windows/src/engine/tsysinfo/UfrmEmail.pas index 0999e7f2c7..6be1ba5ccc 100644 --- a/windows/src/engine/tsysinfo/UfrmEmail.pas +++ b/windows/src/engine/tsysinfo/UfrmEmail.pas @@ -7,12 +7,12 @@ Modified Date: 8 Jun 2012 Authors: mcdurdin - Related Files: - Dependencies: + Related Files: + Dependencies: - Bugs: - Todo: - Notes: + Bugs: + Todo: + Notes: History: 13 May 2005 - mcdurdin - Integrated into kmshell from tsysinfo 16 Aug 2005 - mcdurdin - Add privacy statement 20 Jul 2008 - mcdurdin - I1554 - Don't require password for tsysinfo @@ -141,6 +141,11 @@ begin ShowMessage('The report was not successfully sent. An error was returned: '+IntToStr(Response.StatusCode)); Exit; end; + if Response.StatusCode <> 413 then + begin + ShowMessage('The diagnostic report file was to large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for assistance.'); + Exit; + end; s := Trim(string(Response.MessageBodyAsString)); if Copy(s,1,7) = '' then begin From 0de78e808f9ff419f7c4f68d7b2f06900de1e34d Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Fri, 6 Jun 2025 10:29:14 +1000 Subject: [PATCH 2/5] feat(windows): don't send logs with diagnostics --- windows/src/engine/tsysinfo/sysinfo_main.pas | 43 +------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/windows/src/engine/tsysinfo/sysinfo_main.pas b/windows/src/engine/tsysinfo/sysinfo_main.pas index 3f411e36f8..b1916be9a7 100644 --- a/windows/src/engine/tsysinfo/sysinfo_main.pas +++ b/windows/src/engine/tsysinfo/sysinfo_main.pas @@ -343,56 +343,17 @@ end; procedure TfrmDiagnostics.mnuSendToKeymanClick(Sender: TObject); var ffilename: string; - i: Integer; - f: TSearchRec; - FTotalSize: Int64; - FSavedFileList: string; - FDeleteFiles: Boolean; begin ffilename := TempFileName('.tsi'); - - FTotalSize := 0; - - for i := 0 to FSIList.Files.Count - 1 do - begin - if FindFirst(FSIList.Files[i], 0, f) = 0 then - begin - FTotalSize := FTotalSize + f.Size; - FindClose(f); - end - end; - - FSavedFileList := FSIList.Files.Text; - - FDeleteFiles := False; // I2240 - - if FTotalSize > 1024 * 1024 * 8 then // 8MB - begin - case MessageDlg('The attached files are very large (' + - FileSizeKB(FTotalSize) + - '). Do you want to send them - this may take some time?', mtConfirmation, - mbYesNoCancel, 0) of - mrYes: - FDeleteFiles := True; - mrNo: - FSIList.Files.Text := ''; - mrCancel: - Exit; - end; - end - else - FDeleteFiles := True; // I2240 + // No longer sending log files to Keyman via this upload method + FSIList.Files.Clear; FSIList.Save(ffilename); - FSIList.Files.Text := FSavedFileList; - with TfrmEmail.Create(Self) do try AttachFile := ffilename; if ShowModal = mrOk then - if FDeleteFiles then - DeleteDiagFiles; // I2240 finally DeleteFile(ffilename); Free; From 770506c331c760329f8a2b975106f45eb3633670 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Fri, 6 Jun 2025 11:14:26 +1000 Subject: [PATCH 3/5] feat(windows): tweak diagnositc error message --- windows/src/engine/tsysinfo/UfrmEmail.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/src/engine/tsysinfo/UfrmEmail.pas b/windows/src/engine/tsysinfo/UfrmEmail.pas index 6be1ba5ccc..6044fd73ce 100644 --- a/windows/src/engine/tsysinfo/UfrmEmail.pas +++ b/windows/src/engine/tsysinfo/UfrmEmail.pas @@ -143,7 +143,7 @@ begin end; if Response.StatusCode <> 413 then begin - ShowMessage('The diagnostic report file was to large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for assistance.'); + ShowMessage('The diagnostic report file was too large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for help.'); Exit; end; s := Trim(string(Response.MessageBodyAsString)); From 7ad4ba85275b6045eb72ba07f12413d36ec97720 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:54:32 +1000 Subject: [PATCH 4/5] feat(windows): Fix error checking order --- windows/src/engine/tsysinfo/UfrmEmail.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/windows/src/engine/tsysinfo/UfrmEmail.pas b/windows/src/engine/tsysinfo/UfrmEmail.pas index 6044fd73ce..d3768c5b2b 100644 --- a/windows/src/engine/tsysinfo/UfrmEmail.pas +++ b/windows/src/engine/tsysinfo/UfrmEmail.pas @@ -136,16 +136,16 @@ begin Request.UrlPath := API_Path_SubmitDiag; Upload; + if Response.StatusCode = 413 then + begin + ShowMessage('The diagnostic report file was too large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for help.'); + Exit; + end; if Response.StatusCode <> 200 then begin ShowMessage('The report was not successfully sent. An error was returned: '+IntToStr(Response.StatusCode)); Exit; end; - if Response.StatusCode <> 413 then - begin - ShowMessage('The diagnostic report file was too large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for help.'); - Exit; - end; s := Trim(string(Response.MessageBodyAsString)); if Copy(s,1,7) = '' then begin From 6345a0b9b3f106cf72bef7a823f424f2614ba60e Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:13:02 +1000 Subject: [PATCH 5/5] fix(windows): review comment Co-authored-by: Eberhard Beilharz --- windows/src/engine/tsysinfo/UfrmEmail.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/src/engine/tsysinfo/UfrmEmail.pas b/windows/src/engine/tsysinfo/UfrmEmail.pas index d3768c5b2b..ec096cc057 100644 --- a/windows/src/engine/tsysinfo/UfrmEmail.pas +++ b/windows/src/engine/tsysinfo/UfrmEmail.pas @@ -138,7 +138,7 @@ begin Upload; if Response.StatusCode = 413 then begin - ShowMessage('The diagnostic report file was too large: '+IntToStr(Response.StatusCode)+ 'Contact us via the Keyman Community Forum for help.'); + ShowMessage('The diagnostic report file was too large: '+IntToStr(Response.StatusCode)+ '. Contact us via the Keyman Community Forum for help.'); Exit; end; if Response.StatusCode <> 200 then