Bug 443330 - Undoing/redoing merged strokes from Cumulative Undo tends to result in safe asserts and leftover artifacts
Summary: Undoing/redoing merged strokes from Cumulative Undo tends to result in safe a...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: sh_zam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-05 03:30 UTC by tomtomtomreportingin
Modified: 2021-11-17 14:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2021-10-05 03:30:20 UTC
5.1.0-prealpha (git e5f10d4)

SUMMARY
The Cumulative Undo feature brought back in 5.1 tends to grant safe asserts and leftover artifacts when undoing/redoing merged strokes.

STEPS TO REPRODUCE
1. Open the Undo History docker.
2. Enable Cumulative Undo in the menu.
3. Draw about 10 strokes.
4. Undo/redo any strokes that have been merged.

OBSERVED RESULT
There will tend to be safe asserts like the following:

SAFE ASSERT (krita): "changeList.memento == memento" in file /home/appimage/workspace/Krita_Nightly_Appimage_Build/krita/libs/image/tiles3/kis_memento_manager.cc, line 273

There will also tend to be leftover artifacts from undoing merged strokes on the canvas.

EXPECTED RESULT
No safe asserts and no artifacts.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.12.11 (Appimage)
Comment 1 Bug Janitor Service 2021-10-28 12:54:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1127
Comment 2 Halla Rempt 2021-11-02 12:43:24 UTC
Git commit d7b4df1f1123538b60bd82adc314d3e02c5ad670 by Halla Rempt, on behalf of Sharaf Zaman.
Committed on 02/11/2021 at 12:41.
Pushed by rempt into branch 'master'.

Revert "Fix order of execution of undo commands with cumulative undo"

This reverts commit 46469ed37c4d602f4826d307e857466ea542ab64.

The actualy order in which the merged commands are added to the merged
vector is in reverse. The following commit fixes the asserts for all
cases (for which this commit seems to have been introduced).

M  +10   -11   libs/command/kundo2stack.cpp

https://invent.kde.org/graphics/krita/commit/d7b4df1f1123538b60bd82adc314d3e02c5ad670
Comment 3 Halla Rempt 2021-11-02 12:43:32 UTC
Git commit 3864a5bb79927b0ecbda0f0541c13956c244a8ec by Halla Rempt, on behalf of Sharaf Zaman.
Committed on 02/11/2021 at 12:41.
Pushed by rempt into branch 'master'.

Fix the order in which the commands are merged

In "Implement N rule", the order of merging was reversed, which resulted
in merging being inconsistent with other types of merging (group/time
based) -- this resulted in SAFE_ASSERTS in some cases and but in other
cases.

M  +11   -12   libs/command/kundo2stack.cpp

https://invent.kde.org/graphics/krita/commit/3864a5bb79927b0ecbda0f0541c13956c244a8ec
Comment 4 Halla Rempt 2021-11-02 12:43:52 UTC
Git commit 6956c39f9e42582b4075742281907a9eec12932a by Halla Rempt, on behalf of Sharaf Zaman.
Committed on 02/11/2021 at 12:43.
Pushed by rempt into branch 'krita/5.0'.

Fix the order in which the commands are merged

In "Implement N rule", the order of merging was reversed, which resulted
in merging being inconsistent with other types of merging (group/time
based) -- this resulted in SAFE_ASSERTS in some cases and but in other
cases.
(cherry picked from commit 3864a5bb79927b0ecbda0f0541c13956c244a8ec)

M  +11   -12   libs/command/kundo2stack.cpp

https://invent.kde.org/graphics/krita/commit/6956c39f9e42582b4075742281907a9eec12932a
Comment 5 Dmitry Kazakov 2021-11-17 14:01:34 UTC
Git commit 57def7f40f4df52ae59a4b5e2527f4688d3018f0 by Dmitry Kazakov, on behalf of Sharaf Zaman.
Committed on 17/11/2021 at 13:47.
Pushed by dkazakov into branch 'krita/5.0'.

Revert "Fix order of execution of undo commands with cumulative undo"

This reverts commit 46469ed37c4d602f4826d307e857466ea542ab64.

The actualy order in which the merged commands are added to the merged
vector is in reverse. The following commit fixes the asserts for all
cases (for which this commit seems to have been introduced).

M  +10   -11   libs/command/kundo2stack.cpp

https://invent.kde.org/graphics/krita/commit/57def7f40f4df52ae59a4b5e2527f4688d3018f0