After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653208 - shellDBus: Add GetErrors()
shellDBus: Add GetErrors()
Status: RESOLVED INVALID
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-06-23 02:50 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-08-17 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
extensionSystem: Save extension errors per-extension (4.95 KB, patch)
2011-06-23 02:50 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
shellDBus: Add GetErrors() (1.17 KB, patch)
2011-06-23 02:50 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
shellDBus: Add GetExtensionErrors() (1.19 KB, patch)
2011-06-25 02:52 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
extensionSystem: Start using OUT_OF_DATE (2.39 KB, patch)
2011-07-05 08:33 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-06-23 02:50:10 UTC
This is currently used for the "Error" button you saw in the SweetTooth video.

I'm unsure about this one: JS tracebacks for when the extension is loaded but
fails would be extremely useful as well, but I'm not sure if it belong in
GetErrors().
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-06-23 02:50:12 UTC
Created attachment 190490 [details] [review]
extensionSystem: Save extension errors per-extension

Extension developers may be confused about why their extensions aren't working: the
LookingGlass isn't a very obvious place, or even which errors are theirs. To remedy
this, save all errors per-UUID which allows them to be retrieved later.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-06-23 02:50:15 UTC
Created attachment 190491 [details] [review]
shellDBus: Add GetErrors()

Allow DBus clients to get a list of errors that an extension has produced.
Comment 3 drago01 2011-06-24 14:54:23 UTC
That name is way to generic for that imo.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-06-24 15:33:53 UTC
Yeah, I thought about that this morning... GetExtensionErrors may be better.
Comment 5 drago01 2011-06-24 16:11:27 UTC
Review of attachment 190491 [details] [review]:

Marking needs-work based on the last two comments.
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-06-25 02:52:29 UTC
Created attachment 190634 [details] [review]
shellDBus: Add GetExtensionErrors()

Allow DBus clients to get a list of errors that an extension has produced.



Renamed.
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-07-05 08:33:24 UTC
Created attachment 191270 [details] [review]
extensionSystem: Start using OUT_OF_DATE

We were defining OUT_OF_DATE as a possible state, but never using it
properly.



This isn't that related, but it's the best fit I have.
Comment 8 Giovanni Campagna 2011-07-13 17:30:11 UTC
Review of attachment 190490 [details] [review]:

Mostly fine, I think

::: js/ui/extensionSystem.js
@@ +97,3 @@
 function loadExtension(dir, enabled, type) {
     let info;
     let baseErrorString = 'While loading extension from "' + dir.get_parse_name() + '": ';

Given that all extension related errors are logged with the uuid, can you remove this line and add the message inside logError?
(Bonus point if you find a shorter string, as currently it is awfully long to read in looking glass)
Comment 9 Giovanni Campagna 2011-07-13 17:32:25 UTC
Review of attachment 190634 [details] [review]:

Straightforward, possibly enough to warrant a squash with previous.

::: js/ui/shellDBus.js
@@ +87,3 @@
 
+    GetExtensionErrors: function(uuid) {
+        return ExtensionSystem.errors[uuid] || [];

No JSON here? Don't forget you can't pass structured stuff out of NPAPI, so you would need to JSON-ify it in the plugin.
Comment 10 Jasper St. Pierre (not reading bugmail) 2011-07-13 17:34:23 UTC
(In reply to comment #9)
> Review of attachment 190634 [details] [review]:
> 
> Straightforward, possibly enough to warrant a squash with previous.
> 
> ::: js/ui/shellDBus.js
> @@ +87,3 @@
> 
> +    GetExtensionErrors: function(uuid) {
> +        return ExtensionSystem.errors[uuid] || [];
> 
> No JSON here? Don't forget you can't pass structured stuff out of NPAPI, so you
> would need to JSON-ify it in the plugin.

I do. See:

https://github.com/magcius/sweettooth-plugin/blob/master/sweettooth-plugin.c#L390

(You should probably review my fork of the plugin, too.)
Comment 11 Giovanni Campagna 2011-07-13 17:35:12 UTC
Review of attachment 191270 [details] [review]:

::: js/ui/extensionSystem.js
@@ +160,1 @@
     signals.emit('extension-state-changed', { uuid: uuid,

Wait, where did this come from? There is no emit in the first patch (or did I review the wrong one?)

@@ +227,3 @@
     meta.state = ExtensionState.ERROR;
 
+    if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||

Why is this check moved?
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-07-13 17:57:22 UTC
(In reply to comment #11)
> Review of attachment 191270 [details] [review]:
> 
> ::: js/ui/extensionSystem.js
> @@ +160,1 @@
>      signals.emit('extension-state-changed', { uuid: uuid,
> 
> Wait, where did this come from? There is no emit in the first patch (or did I
> review the wrong one?)
> 
> @@ +227,3 @@
>      meta.state = ExtensionState.ERROR;
> 
> +    if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||
> 
> Why is this check moved?

We need to set "meta.state = ExtensionState.OUT_OF_DATE", and meta is created above. Look closely and you'll see that there's a line inserted that sets that state.
Comment 13 Jasper St. Pierre (not reading bugmail) 2011-07-14 00:13:53 UTC
(In reply to comment #11)
> Review of attachment 191270 [details] [review]:
> 
> ::: js/ui/extensionSystem.js
> @@ +160,1 @@
>      signals.emit('extension-state-changed', { uuid: uuid,
> 
> Wait, where did this come from? There is no emit in the first patch (or did I
> review the wrong one?)

... it's a complicated mess. 'signals' comes from the lookingGlass patch in bug #652614

drago01 thought it was a bit ugly, and I agree. The only other thing that I can think of is a big refactor to make a "ExtensionManager" and create an instance of that in main.js, but I'm not sure it's worth it.
Comment 14 Jasper St. Pierre (not reading bugmail) 2011-07-17 07:43:29 UTC
Sorry for creating a tangled bug mess. I'll have a more linear patch set for all the DBus hacks I need soon.