Bug 393112 - Autosave files don't get made for new documents derived from templates
Summary: Autosave files don't get made for new documents derived from templates
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-04-13 19:15 UTC by Nabil Maghfur usman
Modified: 2019-06-26 23:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
(Video example) (315.51 KB, video/mp4)
2018-10-18 10:30 UTC, mvowada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nabil Maghfur usman 2018-04-13 19:15:34 UTC
I'm using krita 4.0.1 appimage on debian testing.

Krita doesn't create autosave files for new documents derived from templates (eg Design cinema 16:10), so in the event of a crash all the edits a user makes on the template will be lost.

A custom document will get autosave files, so the user can recover some of their work on a custom document if a crash occurs.

Steps to reproduce:
1) Create a new document using the Design cinema 16:10 template, and another custom document.
2) Make some brush strokes on both documents
3) Wait for the autosave delay period to pass for both documents
4) SIGKILL krita or crash it somehow
5) Start krita again

Expected result:
Krita offers to recover autosave files for both documents

Actual result:
Krita only offers to recover the autosave for the custom document
Comment 1 Dmitry Kazakov 2018-04-18 10:58:38 UTC
Weir, I cannot reproduce the issue. Both files get saved...

But Deevad has just reported that autosave fails to work after the first save operation on the file... that might be related.
Comment 2 Dmitry Kazakov 2018-04-18 11:07:51 UTC
I can reproduce neither of the reports :(

If one saves a file, the autosave gets saved into the same directory as the file itself. And the recovery is suggested when one tries to open this file again.
Comment 3 Nabil Maghfur usman 2018-04-19 08:51:27 UTC
(In reply to Dmitry Kazakov from comment #1)
> Weir, I cannot reproduce the issue. Both files get saved...

Does the name of the template file's tab/window view have "[Write Protected]" included in it? if it doesn't then I guess the issue is just with my particular setup.

(In reply to Dmitry Kazakov from comment #2) 
> If one saves a file, the autosave gets saved into the same directory as the
> file itself. And the recovery is suggested when one tries to open this file
> again.

Right, but when one is working on a new document that has not yet been saved (according to the steps I've outlined) then I think krita usually puts the autosave file in the user's home directory and offers to recover that file after a crash or some other failure.
Comment 4 Halla Rempt 2018-04-28 10:15:13 UTC
If the name in the titlebar includes "[Write Protected]" then that means the location cannot be written to; that's not something we can fix. Could you check whether that's the case?
Comment 5 Dmitry Kazakov 2018-05-03 09:11:07 UTC
Hi, Boud!

Can it be that Krita tries to save autosave of the templated file into the same folder with the template itself? Afair, our expected behavior for unnamed documents is to save into home folder, probably we have some specific option for the templates?
Comment 6 Halla Rempt 2018-05-03 09:38:06 UTC
That could be... But it's not the behaviour I'm seeing.
Comment 7 Andrew Crouthamel 2018-09-28 03:15:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Nabil Maghfur usman 2018-10-11 05:38:24 UTC
This bug still exists for me on the 4.2.0-pre-alpha (git 715ad13) appimage I downloaded yesterday.

(In reply to Boudewijn Rempt from comment #4)
> If the name in the titlebar includes "[Write Protected]" then that means the
> location cannot be written to; that's not something we can fix. Could you
> check whether that's the case?

I figured out that templates are stored in directories like /tmp/.mount_krita-hWinAD/usr/share/krita/templates, everything contained in .mount_krita-hWinAD/ is owned by root, so krita can't autosave there.

    drwxrwxr-x  3 root  root         0 Oct 10 00:19  .mount_krita-hWinAD

I tried to chown it but it didn't work, am I using chown incorrectly?

    $ sudo chown -R wyst /tmp/.mount_krita-hWinAD/
    chown: cannot access '/tmp/.mount_krita-hWinAD': Permission denied

Seems to be an issue with my machine, no idea how to fix it though.

I think Krita should warn the user that it can't do an autosave in situations like this, similar to how it warns the user that it is post-poning autosave when the document is busy (can happen when a CPU intensive filter is still processing). The "[Write Protected]" warning only appears in the window title (not visible in fullscreen) and in the tab title (not visible in sub-window mode). It ought to appear in the status bar like the autosave post-pone waring does. Should I make a new wishlist ticket and close this ticket, or just edit this ticket?
Comment 9 Nabil Maghfur usman 2018-10-14 10:45:59 UTC
Updated status to REPORTED and version to nightly appimage (git 715ad13)
Comment 10 mvowada 2018-10-18 10:30:49 UTC
Created attachment 115717 [details]
(Video example)

I can reproduce this with the latest Krita 4.2.0-pre-alpha (git a2ae7f3) and with Krita 4.1.5 as well (see video).
Comment 11 mvowada 2018-10-18 10:31:19 UTC
Confirming.
Comment 12 Halla Rempt 2019-05-16 11:34:07 UTC
Git commit 292b1db151704be3779874fed8e21fac4ad02798 by Boudewijn Rempt.
Committed on 16/05/2019 at 11:33.
Pushed by rempt into branch 'master'.

Autosave in the unnamed location if the current document was readonly

M  +1    -1    libs/ui/KisDocument.cpp

https://invent.kde.org/kde/krita/commit/292b1db151704be3779874fed8e21fac4ad02798
Comment 13 Halla Rempt 2019-05-16 11:34:09 UTC
Git commit 31bc40499b259705f96b10140667145f75466e77 by Boudewijn Rempt.
Committed on 16/05/2019 at 11:32.
Pushed by rempt into branch 'master'.

Set the document we created from a template to read/write

If the template is in a read-only folder (like an installation
location) the document would be set to ReadOnly, which is wrong.

M  +1    -0    libs/ui/KisPart.cpp

https://invent.kde.org/kde/krita/commit/31bc40499b259705f96b10140667145f75466e77
Comment 14 Halla Rempt 2019-05-17 08:13:00 UTC
Git commit 2f984c10ecf7cd6c7da36d211104112222576bee by Boudewijn Rempt.
Committed on 17/05/2019 at 08:12.
Pushed by rempt into branch 'krita/4.2'.

Set the document we created from a template to read/write

If the template is in a read-only folder (like an installation
location) the document would be set to ReadOnly, which is wrong.

M  +1    -0    libs/ui/KisPart.cpp

https://invent.kde.org/kde/krita/commit/2f984c10ecf7cd6c7da36d211104112222576bee
Comment 15 Halla Rempt 2019-05-17 08:13:01 UTC
Git commit 4b3cf1c93de0af4704f745201bbdd87874a5c495 by Boudewijn Rempt.
Committed on 17/05/2019 at 08:12.
Pushed by rempt into branch 'krita/4.2'.

Autosave in the unnamed location if the current document was readonly

M  +1    -1    libs/ui/KisDocument.cpp

https://invent.kde.org/kde/krita/commit/4b3cf1c93de0af4704f745201bbdd87874a5c495