Bug 421342 - Files lost after being told they cannot be saved
Summary: Files lost after being told they cannot be saved
Status: RESOLVED DUPLICATE of bug 402017
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.3.3
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-11 15:43 UTC by bark mallard
Modified: 2020-05-11 20:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-461-0.html (1.19 KB, text/html)
2020-05-11 16:27 UTC, bark mallard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bark mallard 2020-05-11 15:43:35 UTC
SUMMARY

Okular said it couldn't save pdfs because they had been modified by some other program. The files were consequently lost. They had not, as far as I am aware, been modified by another programme. I had pdfs open in Okular on different workspaces on Xubuntu. These had been downloaded using Firefox. Some had been saved, some had not. The files were open for a period of days. When I came to tidy them up, and save those that needed to be retained but had not yet been saved, Okular reported, for each file that had not already been saved, that it could not be saved, for the inexplicable reason given. It was however able to save again those files that had already been saved. It was possible to see, when attempting to save those files that would not, that Okular was keeping them in /tmp. They are not apparently there now, after closing them.

STEPS TO REPRODUCE
I can't be sure how to reproduced this error. But approximately:

1. Open a bunch of pdfs from Firefox, using Okular
2. Don't save the files
3. Keep them open for a period of days
4. Attempt to save them using <save as>

Like I say, nothing suggests to me this will produce the error. I've not experienced it before. But only recently have I started using Okular greatly.


OBSERVED RESULT

When trying to save one of these files that had not yet been saved, Okular opened the save file dialog and allowed the procedure to continue, but upon receiving the instruction to save the file, Okular gave this error:

"The file ... .pdf has been modified by another program, which means it can no longer be saved"

The file was not saved. There was no obvious way of preventing the file from being lost.  

The same did not happen with files that had already been saved. I do not know if these were files that had been saved, closed and reopened, or whether they were files that had been opened from the browser, saved and left open.

EXPECTED RESULT

Open pdf files can be saved as something else to another location, no matter what their state. If another program has not modified an open pdf (which in this case I am reasonably sure it has not), then Okular should not report that it has. In any case, this should not prevent an open pdf being saved to another location / with another name.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: kde-plasma-desktop/bionic 5:100ubuntu2 amd64
KDE Frameworks Version: 5.44 + 5.78 (please see below)

Qt Version: 5.14.1 + 5.9.5 (please see below)


ADDITIONAL INFORMATION

xfce: xfce4/bionic,bionic 4.12.4 all
xubuntu: Ubuntu 18.04.4 LTS

Interestingly, I seem to have 3 versions of Okular installed. At least, the xfce application menu lists okular three times when I ask for it in the search box

1.

Version : 1.10.0
KDE Frameworks 5.68.0
Qt 5.14.1 (built against 5.14.1)
The xcb windowing system

2.

Version: 1.3.3
KDE Frameworks 5.44.0
Qt 5.9.5 (built against 5.9.5)
The xcb windowing system

3.

Version: 1.10.0

KDE Frameworks 5.68.0
Qt 5.14.1 (built against 5.14.1)
The xcb windowing system

Yes, 1 and 3 look like the same implementation.

When I open a doc with Firefox, or with 'open with okular' from my file browser, it opens with 2.: v.1.3.3

apt, however, says the following okular packages are installed:

libokular5core8/bionic,now 4:17.12.3-0ubuntu1 amd64 [installed,automatic]
okular/bionic,now 4:17.12.3-0ubuntu1 amd64 [installed]
okular-backend-odp/bionic,now 1:3.0.1-0ubuntu4 amd64 [installed,automatic]
okular-backend-odt/bionic,now 1:3.0.1-0ubuntu4 amd64 [installed,automatic]

snap, on the other hand, says I have this version installed:

okular                           20.04.0                     98    latest/stable  kde*         -
Comment 1 Yuri Chornoivan 2020-05-11 15:59:08 UTC
I guess this bug report also can be named "Firefox deletes temporary files when it wants to do so". It is unsafe to use Okular for editing or viewing such files without immediately saving them outside the temporary folder.

Am I right?
Comment 2 bark mallard 2020-05-11 16:27:45 UTC
Created attachment 128365 [details]
attachment-461-0.html

> --- Comment #1 from Yuri Chornoivan <yurchor@ukr.net> ---
> I guess this bug report also can be named "Firefox deletes temporary files
> when
> it wants to do so". It is unsafe to use Okular for editing or viewing such
> files without immediately saving them outside the temporary folder.
>
> Am I right?
>
>
Of course not! You are passing the buck!

When Okular takes the file from Firefox, it assumes responsibility for the
care of that file. If I, as a user, find that Okular prevents the file
being saved, then Okular has failed me. And as a user with some experience,
I can say this error seems unique in all that experience, and it seems
logical to expect that as file that is open is a file that can be saved,
regardless of what happens to the underlying file, just as with any text
editor.
Comment 3 David Hurka 2020-05-11 20:43:52 UTC
We don’t need to evaluate how Okular should behave when files are deleted, we already did that in the other bug.

I don’t know how to fix this; the fix is already in production code, but I don’t know why it doesn’t work. Maybe it is just that people compile Okular without OKULAR_KEEP_FILE_OPEN?

*** This bug has been marked as a duplicate of bug 402017 ***