From 2c73e366eaad53afb5c12244a17e0afebe7cc72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Fern=C3=A1ndez=20D=C3=ADaz?= <42654671+oscfdezdz@users.noreply.github.com> Date: Sun, 19 Jan 2025 09:43:19 +0100 Subject: [PATCH 1/2] flatpak: Update blueprint to v0.16.0 --- build-aux/com.mattjakeman.ExtensionManager.Devel.json | 4 ++-- build-aux/com.mattjakeman.ExtensionManager.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build-aux/com.mattjakeman.ExtensionManager.Devel.json b/build-aux/com.mattjakeman.ExtensionManager.Devel.json index 573d3cca..0f7dfea2 100644 --- a/build-aux/com.mattjakeman.ExtensionManager.Devel.json +++ b/build-aux/com.mattjakeman.ExtensionManager.Devel.json @@ -37,8 +37,8 @@ { "type" : "git", "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler.git", - "commit" : "8e10fcf8692108b9d4ab78f41086c5d7773ef864", - "tag" : "v0.14.0" + "commit" : "04ef0944db56ab01307a29aaa7303df6067cb3c0", + "tag" : "v0.16.0" } ] }, diff --git a/build-aux/com.mattjakeman.ExtensionManager.json b/build-aux/com.mattjakeman.ExtensionManager.json index 084609bc..87fb0911 100644 --- a/build-aux/com.mattjakeman.ExtensionManager.json +++ b/build-aux/com.mattjakeman.ExtensionManager.json @@ -36,8 +36,8 @@ { "type" : "git", "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler.git", - "commit" : "8e10fcf8692108b9d4ab78f41086c5d7773ef864", - "tag" : "v0.14.0" + "commit" : "04ef0944db56ab01307a29aaa7303df6067cb3c0", + "tag" : "v0.16.0" } ] }, @@ -70,8 +70,8 @@ { "type" : "git", "url" : "https://github.com/mjakeman/extension-manager", - "commit" : "62f3759e10cfd21014c805dc75645947569d48a9", - "tag" : "v0.6.0" + "commit" : "54585fc15c3fe4939f2ba22ebc8808e6ef46c8f4", + "tag" : "v0.6.1" } ] } From 38e240984e4d9d3671610c19e4c14341f4006253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Fern=C3=A1ndez=20D=C3=ADaz?= <42654671+oscfdezdz@users.noreply.github.com> Date: Sat, 11 Jan 2025 21:13:55 +0100 Subject: [PATCH 2/2] comment-dialog: Fix crash on close while loading Partially reverts a389ff389ad09f8bc13f77140e890166ea53d9fc which was mostly a workaround and uses GObject's dispose to cancel the ongoing request if the dialog is closed before it is completed. Fix https://github.com/mjakeman/extension-manager/issues/310 --- src/exm-comment-dialog.c | 42 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/exm-comment-dialog.c b/src/exm-comment-dialog.c index e113608b..534eb7aa 100644 --- a/src/exm-comment-dialog.c +++ b/src/exm-comment-dialog.c @@ -35,7 +35,6 @@ struct _ExmCommentDialog ExmCommentProvider *comment_provider; GCancellable *cancellable; - gboolean closed; GtkListBox *list_box; GtkStack *stack; @@ -64,6 +63,16 @@ exm_comment_dialog_new (int web_id) NULL); } +static void +exm_comment_dialog_dispose (GObject *object) +{ + ExmCommentDialog *self = (ExmCommentDialog *)object; + + g_cancellable_cancel (self->cancellable); + + G_OBJECT_CLASS (exm_comment_dialog_parent_class)->dispose (object); +} + static void exm_comment_dialog_get_property (GObject *object, guint prop_id, @@ -105,6 +114,7 @@ exm_comment_dialog_class_init (ExmCommentDialogClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + object_class->dispose = exm_comment_dialog_dispose; object_class->get_property = exm_comment_dialog_get_property; object_class->set_property = exm_comment_dialog_set_property; object_class->constructed = exm_comment_dialog_constructed; @@ -143,17 +153,25 @@ comment_factory (ExmComment *comment, static void on_get_comments (GObject *source, GAsyncResult *res, - ExmCommentDialog *self) + gpointer user_data) { + GListModel *model; GError *error = NULL; + ExmCommentDialog *self; - if (self->closed) - return; + g_return_if_fail (user_data != NULL); - GListModel *model = exm_comment_provider_get_comments_finish (EXM_COMMENT_PROVIDER (source), res, &error); + model = exm_comment_provider_get_comments_finish (EXM_COMMENT_PROVIDER (source), res, &error); + self = (ExmCommentDialog *) user_data; if (error && error->code != 404) { + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + { + g_clear_error (&error); + return; + } + // Filter 5xx status codes (server errors) if (error->code / 100 == 5) adw_status_page_set_description (self->error_status, _("Check GNOME infrastructure status and try again later")); @@ -162,6 +180,8 @@ on_get_comments (GObject *source, gtk_stack_set_visible_child_name (self->stack, "page_error"); + g_clear_error (&error); + return; } @@ -172,20 +192,12 @@ on_get_comments (GObject *source, g_object_ref (self), g_object_unref); } -static void -on_dialog_closed (ExmCommentDialog *self) -{ - self->closed = TRUE; -} - static void exm_comment_dialog_constructed (GObject *object) { ExmCommentDialog *self = EXM_COMMENT_DIALOG (object); gtk_stack_set_visible_child_name (self->stack, "page_spinner"); - - g_cancellable_cancel (self->cancellable); self->cancellable = g_cancellable_new (); exm_comment_provider_get_comments_async (self->comment_provider, @@ -204,9 +216,5 @@ exm_comment_dialog_init (ExmCommentDialog *self) gtk_widget_init_template (GTK_WIDGET (self)); self->comment_provider = exm_comment_provider_new (); - - self->closed = FALSE; - - g_signal_connect (self, "closed", G_CALLBACK (on_dialog_closed), NULL); }