Merge ~nteodosio/update-manager:jammy-ua into update-manager:ubuntu/jammy

Proposed by Nathan Teodosio
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 829ab06df1312c8f8c2a870cf0e9c22cc6a579a9
Merged at revision: 829ab06df1312c8f8c2a870cf0e9c22cc6a579a9
Proposed branch: ~nteodosio/update-manager:jammy-ua
Merge into: update-manager:ubuntu/jammy
Diff against target: 50 lines (+31/-0)
2 files modified
data/gtkbuilder/UpdateManager.ui (+24/-0)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+457139@code.launchpad.net

Description of the change

Do not crash when updating Update Manager from inside itself.

Please refer to LP:2045918 for full context and test case.

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

Ooh interesting. I wonder if we could solve this more general by just keeping the UI file in memory or something. It is surprising that it tries to re-read the file while running.

Revision history for this message
Sebastien Bacher (seb128) wrote :

We should probably make it a GResource (https://docs.gtk.org/gio/struct.Resource.html) going forward, which would make it included in the binary, but that's not going to fix that case today where upgrading from a previous version where it was not

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I can confirm it's making the backtrace/error report issue go away. The corresponding widgets vanishes from the UI after the refresh but the details view is still working and the widget can be resized so that's good enough I think.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/data/gtkbuilder/UpdateManager.ui b/data/gtkbuilder/UpdateManager.ui
2index d82f816..c4f4362 100644
3--- a/data/gtkbuilder/UpdateManager.ui
4+++ b/data/gtkbuilder/UpdateManager.ui
5@@ -5,6 +5,30 @@
6 <property name="visible">True</property>
7 <property name="can_focus">False</property>
8 <property name="spacing">12</property>
9+ <!--
10+ https://launchpad.net/bugs/2045918
11+ Old widgets from 22.04.9 need to be kept, even though invisible, because
12+ otherwise updating Update Manager itself via Update Manager will crash when
13+ Update Manager recalculates itself. That is because the old Update Manager
14+ file is still the being executed, whereas this ui file will be the new one.
15+ -->
16+ <child>
17+ <object class="GtkNotebook" id="notebook_details">
18+ <property name="visible">False</property>
19+ </object>
20+ </child>
21+ <child>
22+ <object class="GtkExpander" id="expander_desc">
23+ <property name="visible">False</property>
24+ </object>
25+ </child>
26+ <child>
27+ <object class="GtkTextView" id="textview_descr">
28+ <property name="visible">False</property>
29+ </object>
30+ </child>
31+ <!-- End of old widgets -->
32+
33 <child>
34 <object class="GtkExpander" id="expander_news">
35 <property name="visible">False</property>
36diff --git a/debian/changelog b/debian/changelog
37index a98fc5e..a7e662e 100644
38--- a/debian/changelog
39+++ b/debian/changelog
40@@ -1,3 +1,10 @@
41+update-manager (1:22.04.18) jammy; urgency=medium
42+
43+ * Add back removed widgets to UI file to fix crash when updating
44+ Upgrade Manager from inside itself (LP: #2045918).
45+
46+ -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Fri, 08 Dec 2023 11:23:26 +0100
47+
48 update-manager (1:22.04.17) jammy; urgency=medium
49
50 * Fix incorrect available version for Ubuntu Pro updates in unattached case

Subscribers

People subscribed via source and target branches