Live Editing broken in 5.12.8/9 upstream

Bug #1884550 reported by Doug Massay
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtwebengine-opensource-src (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

Ubuntu 20.04 LTS

[Impact]

QtWebEngine bad chrome 77->69 cherry-pick bug broke live editing in Qt 5.12.8 and Qt 5.12.9. The bad merge breaks styled markup traverse by accidentally inverting condition. Results in loss of content under certain conditions.

Bug acknowledged: https://bugreports.qt.io/browse/QTBUG-85160

Official patch-set to fix: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/305139

Please consider cherry-picking this official patch, so that the latest Ubuntu LTS release does not break apps that rely upon QtWebEngine's live-editing capabilities

I co-maintain some open-source ebook editing software (https://github.com/sigil-ebook/pageedit) that allows users to make basic wysiwyg edits to local xhtml files loaded in a QWebEngineView using QWebEngine's live editing abilities. They basically highlight paragraphs and convert them to ordered/unordered lists via view->triggerPageAction(QWebEnginePage::InsertUnorderedList) and view->triggerPageAction(QWebEnginePage::InsertOrderedList) accordingly.

This all works in Qt5.12.7 and earlier, but when using Ubuntu 20.04's 5.12.8 QWebEngine packages, the highlighted content is deleted and an empty list is created (as per the aforementioned Qt bug confirmed and patched by Qt).

[Test Case]

I've attached a small, focused, Qt project that clearly demonstrates the issue. It can be built with the standard qmake / make commands which will build a liveedit binary that loads a local xhtml file in a QWebView for editing.

https://bugs.launchpad.net/ubuntu/+source/qtwebengine-opensource-src/+bug/1884550/+attachment/5386530/+files/liveedit.tar.gz

If you want to load your own local html file or a remote url, just pass the url as a parameter to ./liveedit:

./liveedit file:///home/user/localfile.html
./liveedit https://www.lipsum.com/feed/html

Otherwise, no parameter means the included xhtml file will be loaded.

Once loaded, highlight all the paragraphs and use the "Tools->Create List from selection" menu action to edit the rendered content.

Qt5.12.7 and earlier will correctly create a list from the highlighted paragraphs (as will Qt5.14.x and later), but Qt5.12.8/9 will incorrectly delete the highlighted content and create an empty list (as per the aforementioned Qt bug confirmed and patched by Qt).

[Regression Potential]

This fixes the condition in the if/else block and restores the order that was present in earlier Qt 5.12.x releases, e.g. in Ubuntu Eoan which has 5.12.4. So the potential for regressions is minimal, and any potential regression will be related to live editing.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks for the heads up! I will fix it.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Can you please add some test case to the bug description? Like what app or website you are using, what exactly you are doing, etc?

This is needed per our stable release update procedure: <https://wiki.ubuntu.com/StableReleaseUpdates#Procedure>.

Also, I have verified that the bad code is not present in 5.14.2, so marking it as fixed in Groovy (20.10).

Changed in qtwebengine-opensource-src (Ubuntu):
status: New → Fix Released
Revision history for this message
Doug Massay (dmassay) wrote :

I assumed that Qt's own acknowledgement of the issue, and subsequent official patch to correct it, would be sufficient to demonstrate the necessity of incorporating said fix into a package that's part of an Ubuntu LTS release.

I'll see what I can do about putting together a small test case (for an already confirmed upstream mistake), but it may not be immediately.

Thanks for looking into it.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

> I assumed that Qt's own acknowledgement of the issue, and subsequent official patch to correct it, would be sufficient to demonstrate the necessity of incorporating said fix into a package that's part of an Ubuntu LTS release.

It would be sufficient for me, but not for the SRU team who will review the fix.

Revision history for this message
Doug Massay (dmassay) wrote :

Understood. I'll get something together as soon as I can. Thanks again.

Revision history for this message
Doug Massay (dmassay) wrote :
description: updated
description: updated
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks!

I have uploaded the fix, it is now waiting for review in the queue: https://launchpad.net/ubuntu/focal/+queue?queue_state=1

description: updated
description: updated
Revision history for this message
Doug Massay (dmassay) wrote :

Fingers crossed. Thanks!

Mattia Rizzolo (mapreri)
Changed in qtwebengine-opensource-src (Ubuntu Focal):
status: New → In Progress
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Doug, or anyone else affected,

Accepted qtwebengine-opensource-src into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qtwebengine-opensource-src/5.12.8+dfsg-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in qtwebengine-opensource-src (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Robie Basak (racb) wrote :

> I assumed that Qt's own acknowledgement of the issue, and subsequent official patch to correct it, would be sufficient to demonstrate the necessity of incorporating said fix into a package that's part of an Ubuntu LTS release.

We won't accept a patch in a stable release without verifying that it works as intended first, and that requires a test case. Our packaging can mean that a patch that works for upstream doesn't work for us, and the same challenges apply when cherry-picking. Thank you for providing the test case!

Revision history for this message
Doug Massay (dmassay) wrote :

> Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

> If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Will do. Thanks!

Revision history for this message
Doug Massay (dmassay) wrote :

I updated libqt5webengine5 and its dependencies to version 5.12.8+dfsg-0ubuntu1.1 from focal-proposed and verified (with the originally provided test case) that the bug is indeed fixed. I also tested with the open-source project I maintain to verify that the upstream Live Editing breakage was fixed with the update.

Changing the tag to "verification-done-focal" as requested.

Thank you kindly for the assist. This would have affected any package that relied upon qtwebengine's Live Editing abilities, so it's much appreciated.

If and when 20.04 moves to Qt5.12.9, the same patch will be necessary. Is there anything that can be done to make sure the pach doesn't get dropped in that situation?

Thanks again.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Unfortunately we can't move to 5.12.9 — that will require a rebuild of all packages that use private Qt ABI, which is not possible for stable release updates.

If there are any specific fixes from 5.12.9 that you want to have in 20.04, please open separate bugs for them.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (qtwebengine-opensource-src/5.12.8+dfsg-0ubuntu1.1)

All autopkgtests for the newly accepted qtwebengine-opensource-src (5.12.8+dfsg-0ubuntu1.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

pyside2/5.14.0-1~exp1ubuntu5 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#qtwebengine-opensource-src

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Doug Massay (dmassay) wrote :

Looks like a flaky test, rather than a real regression to me:

> <VirtSubproc>: failure: timed out waiting for testbed to reboot
> autopkgtest [08:11:33]: ERROR: testbed failure: cannot send to testbed: [Errno 32] Broken pipe

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I have retried that test, and it passed now.

Revision history for this message
Doug Massay (dmassay) wrote :

Good news. Thanks! So if no other problems arise, this will automatically move to -updates (after the 7 day minimum), correct?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Yes but manually, not automatically.

Revision history for this message
Doug Massay (dmassay) wrote :

I'm not pushing, I just want to make sure there's nothing else holding this back from being moved to -updates that I can help with.

Thanks

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

You can look at <https://people.canonical.com/~ubuntu-archive/pending-sru.html>. All is green, just be patient. There is no promoting on Fridays or on weekends, so I guess it will be promoted in the beginning of next week.

Revision history for this message
Doug Massay (dmassay) wrote :

Well shoot. If someone had told me about Ubuntu's 3-day weekend policy, I would have mentioned it yesterday when the seven day minimum was up. ;)

Sorry. I'm being impatient--I know this.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtwebengine-opensource-src - 5.12.8+dfsg-0ubuntu1.1

---------------
qtwebengine-opensource-src (5.12.8+dfsg-0ubuntu1.1) focal; urgency=medium

  * Backport upstream patch to fix live editing (LP: #1884550).

 -- Dmitry Shachnev <email address hidden> Tue, 23 Jun 2020 21:10:05 +0300

Changed in qtwebengine-opensource-src (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for qtwebengine-opensource-src has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.