Bug 417757

Summary: LivePreview error popup
Product: [Applications] kile Reporter: Klaus Frank <bugs.kde.org>
Component: user interfaceAssignee: Michel Ludwig <michel.ludwig>
Status: REPORTED ---    
Severity: normal CC: paulatz, shops
Priority: NOR    
Version: 2.9.93   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: example project with multiple files

Description Klaus Frank 2020-02-16 20:38:28 UTC
SUMMARY

When live compiling is enabled, it should fail silently if the document was edited while the compile was ongoing. Currently it throws an error popup `Could not open file:///tmp/kile-livepreview.hXnbwm/main.pdf` which disrupts the flow.


STEPS TO REPRODUCE
1. Enable LivePreview
2. Set compile time to 1 sec
3. Start typing
4. Stop typing for 1 second and once it starts compiling (indicated by the console text) start typing again.
5. The error popup appears for every letter typed until the compile finished.

OBSERVED RESULT
Error popup and error message in console
```
[LivePreview-PDFLaTeX] crashed
[LivePreview-PDFLaTeX] finished abruptly
[LivePreview-PDFLaTeX] Aborted
```

EXPECTED RESULT
No popup the LivePreview should in this case just fail or compile the older result, as it was when starting to compile.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux (x86_64) release 5.5.3-arch1-1
(available in About System)
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1 (built against 5.14.1)
KILE Version: 2.9.93

ADDITIONAL INFORMATION
Comment 1 lp 2022-10-19 14:01:36 UTC
Created attachment 153031 [details]
example project with multiple files

I can produce this bug even without auto-compilation of the livew preview in the following way:

1. Enable Live Preview
2. Create a Project with a main file that includes two other files, i.e. main.tex which call   \input{first.tex} \input{second.tex}
3. Add all these files to a project
4. Move to first.tex, edit it and save, which will trigger a recompilation
5. Before the recompilation finishes, switch to the tab of second.tex

The error will be repeated after every keypress, making any further work impossible. The only solution is to save again to trigger a recompilation and stay absolutely still until it finishes (which can take quite a while for large documents).

The recompilation should use a copy of the files, and ignore any changes that has happened since it started, or in the worst case, abort silently and keep the existing preview. Blocking the interface with a modal window is extremely annoying.

With multiple files it is worst, because it obliges one to either:
1. Save the current file before moving to another file, and wait until compilation is over to switch
2. Never save, until one wants to actually regenerate the document, at that point reopen every file, save, wait, repeat

p.s. While creating a test project to attach to this bug, I found that having more than one project open make the situation even worst, where editing one project triggers the modal windows until all the projects have recompiled.