notificationDaemon: Catch exceptions while loading notifications
An Endless OS system was found in the wild with a malformed .local/share/gnome-shell/notifications which causes _loadNotifications() to raise an exception. This exception was not previously handled and bubbles all the way out to gnome_shell_plugin_start(), whereupon the shell exit(1)s. The user could no longer log into their computer. Handle exceptions from _loadNotifications(), log them, and attempt to continue. Ensure that this._isLoading is set to 'false' even on error, so that future calls to _saveNotifications() can overwrite the (corrupt) state file. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1552
This commit is contained in:
parent
a207f67f73
commit
e5cde4700f
@ -750,6 +750,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
|
|||||||
_loadNotifications() {
|
_loadNotifications() {
|
||||||
this._isLoading = true;
|
this._isLoading = true;
|
||||||
|
|
||||||
|
try {
|
||||||
let value = global.get_persistent_state('a(sa(sv))', 'notifications');
|
let value = global.get_persistent_state('a(sa(sv))', 'notifications');
|
||||||
if (value) {
|
if (value) {
|
||||||
let sources = value.deep_unpack();
|
let sources = value.deep_unpack();
|
||||||
@ -771,9 +772,12 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logError(e, 'Failed to load saved notifications');
|
||||||
|
} finally {
|
||||||
this._isLoading = false;
|
this._isLoading = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_saveNotifications() {
|
_saveNotifications() {
|
||||||
if (this._isLoading)
|
if (this._isLoading)
|
||||||
|
Loading…
Reference in New Issue
Block a user