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 662967 - Repeat of versions check in extensionSystem.js
Repeat of versions check in extensionSystem.js
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-28 19:37 UTC by Finnbarr P. Murphy
Modified: 2011-10-28 20:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
extensionSystem: Remove duplciated version check (1.08 KB, patch)
2011-10-28 19:48 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Finnbarr P. Murphy 2011-10-28 19:37:44 UTC
Why the double check for Shell/JavaScript versions in extensionSystem.js?  The second check does not appear to be doing anything new except setting meta.state.  Surely this code could be improved to remove the second check.

    if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||
        (meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) {
        logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version');
        return;
    }

    extensionMeta[uuid] = meta;
    meta.type = type;
    meta.dir = dir;
    meta.path = dir.get_path();
    meta.error = '';

    // Default to error, we set success as the last step
    meta.state = ExtensionState.ERROR;

    if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||
        (meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) {
        logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version', ExtensionState.OUT_OF_DATE);
        meta.state = ExtensionState.OUT_OF_DATE;
        return;
    }
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-10-28 19:48:21 UTC
Created attachment 200207 [details] [review]
extensionSystem: Remove duplciated version check

This piece of accidentally duplicated code made sure that the OUT_OF_DATE
status was never set.


Good catch.
Comment 2 Giovanni Campagna 2011-10-28 20:10:06 UTC
Review of attachment 200207 [details] [review]:

Looks good to me.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-10-28 20:13:18 UTC
Attachment 200207 [details] pushed as 203c5db - extensionSystem: Remove duplciated version check