linux-man / gnome-shell-extension-printers

Gnome extension - Manage Jobs and Printers
GNU General Public License v3.0
14 stars 13 forks source link

Clean install gives error #14

Closed chookapp closed 4 years ago

chookapp commented 4 years ago

I uninstalled the extension and made sure the installation directory is gone. I reinstalled and got the following error:

gnome-shell[2525]: JS ERROR: ReferenceError: ByteArray is not defined
 spawn_async@/home/user/.local/share/gnome-shell/extensions/printers@linux-man.org/extension.js:31:13
 PrintersManager<.refresh@/home/user/.local/share/gnome-shell/extensions/printers@linux-man.org/extension.js:111:9
 wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
 PrintersManager<.warningTimeout@/home/user/.local/share/gnome-shell/extensions/printers@linux-man.org/extension.js:203:9
 wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22

I'm using Ubuntu 18.04 Gnome 3.28.2

linux-man commented 4 years ago

That's strange... please confirm the installed version at metadata.json, because: ByteArray was added at version 9, commit #10 - mapped to gnome-shell 3.30 and above. Ubuntu 18.04 should still install version 8.

chookapp commented 4 years ago

My metadata.json:

{
  "_generated": "Generated by SweetTooth, do not edit", 
  "description": "Manage Jobs and Printers", 
  "extension-id": "printers", 
  "name": "Printers", 
  "original-authors": [
    "joao.caldas.lopes@gmail.com"
  ], 
  "settings-schema": "org.gnome.shell.extensions.printers", 
  "shell-version": [
    "3.20", 
    "3.22", 
    "3.24", 
    "3.26", 
    "3.28", 
    "3.30"
  ], 
  "url": "https://github.com/linux-man/gnome-shell-extension-printers", 
  "uuid": "printers@linux-man.org", 
  "version": 8
}
linux-man commented 4 years ago

That looks OK. At extension.js, line 31-32 you should have (version 8)

        while (out !== null) {
            strOUT += out + '\n';

, not (version 10)

        while (out !== null) {
            strOUT += ByteArray.toString(out) + '\n';
chookapp commented 4 years ago

OK, this is spooky

Indeed line 31-32 doesn't contain ByteArray.

if(success) {
        let out_reader = new Gio.DataInputStream({base_stream: new Gio.UnixInputStream({fd: out_fd})});
        let [out, size] = out_reader.read_line(null);
        while (out !== null) {
            strOUT += out + '\n';
            [out, size] = out_reader.read_line(null);
        }
    }

In fact ByteArray is nowhere to be found in any of the files in that directory.

Can it be some caching issue?

chookapp commented 4 years ago

Yup, it was an odd shell cache issue. Restart solved it