Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't start #31

Closed
gummipunkt opened this issue Dec 14, 2022 · 6 comments
Closed

Doesn't start #31

gummipunkt opened this issue Dec 14, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@gummipunkt
Copy link

Hi,

I'm using macOS (M1), latest OS version. Installed with homebrew (like recommend in the docs). Started it and it worked (v 0.1.x). Then a popup stated that a update is available, so I updated to the latest version (0.2.x). Now it doesn't start anymore:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: string \"{\\n    \\\"always_on_top\\\": false,\\n    \\\"theme\\\": \\\"Light\\\",\\n    \\\"titlebar\\\": true,\\n    \\\"default_origin\\\": \\\"https://chat.openai.com\\\",\\n    \\\"origin\\\": \\\"https://chat.openai.com\\\",\\n    \\\"ua_pc\\\": \\\"\\\",\\n    \\\"ua_phone\\\": \\\"\\\"\\n}\", expected struct ChatConfJson", line: 0, column: 0)', src/conf.rs:125:70
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

--> export RUST_BACKTRACE=full

/Applications/ChatGPT.app/Contents/MacOS/ChatGPT
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: string \"{\\n    \\\"always_on_top\\\": false,\\n    \\\"theme\\\": \\\"Light\\\",\\n    \\\"titlebar\\\": true,\\n    \\\"default_origin\\\": \\\"https://chat.openai.com\\\",\\n    \\\"origin\\\": \\\"https://chat.openai.com\\\",\\n    \\\"ua_pc\\\": \\\"\\\",\\n    \\\"ua_phone\\\": \\\"\\\"\\n}\", expected struct ChatConfJson", line: 0, column: 0)', src/conf.rs:125:70
stack backtrace:
   0:        0x104adedf7 - __mh_execute_header
   1:        0x104a5054a - __mh_execute_header
   2:        0x104ab3abc - __mh_execute_header
   3:        0x104ae239b - __mh_execute_header
   4:        0x104ae2ab5 - __mh_execute_header
   5:        0x104ae26d4 - __mh_execute_header
   6:        0x104ae2638 - __mh_execute_header
   7:        0x104ae2602 - __mh_execute_header
   8:        0x104b978f3 - __mh_execute_header
   9:        0x104b97b55 - __mh_execute_header
  10:        0x104a4a194 - __mh_execute_header
  11:        0x104a0bf0b - __mh_execute_header
  12:        0x104972d34 - __mh_execute_header
  13:        0x104a0bad2 - __mh_execute_header
@lencx
Copy link
Owner

lencx commented Dec 15, 2022

I am very sorry that I made a major mistake here and did not make a compatible treatment because the data structure changed. I will optimize this situation in the next release to avoid it from happening again.

If you cannot open the application after the upgrade, please try to clear the configuration file, which is in the ~/.chatgpt/* directory.

@lencx lencx added the bug Something isn't working label Dec 15, 2022
@lencx lencx pinned this issue Dec 15, 2022
@lencx lencx closed this as completed Dec 15, 2022
@Manamama
Copy link

Same error in Ubuntu:

sudo dpkg -i chat-gpt_0.7.3_amd64.deb 
(Reading database ... 508762 files and directories currently installed.)
Preparing to unpack chat-gpt_0.7.3_amd64.deb ...
Unpacking chat-gpt (0.7.3) over (0.7.3) ...
Setting up chat-gpt (0.7.3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

then:

RUST_BACKTRACE=full chat-gpt
[2022-12-30][12:09:57][chatgpt::app::setup][INFO] stepup
[2022-12-30][12:09:57][chatgpt::app::setup][INFO] global_shortcut_start
[2022-12-30][12:09:57][chatgpt::app::setup][INFO] is_registered: true
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: GlobalShortcut(InvalidAccelerator("Unable to register global shortcut"))', src/app/setup.rs:36:18
stack backtrace:
   0:     0x556974e700b3 - <unknown>
   1:     0x556974d8e01e - <unknown>
   2:     0x556974e444b4 - <unknown>
   3:     0x556974e7133f - <unknown>
   4:     0x556974e70f3f - <unknown>
   5:     0x556974e71fc8 - <unknown>
   6:     0x556974e71a92 - <unknown>
   7:     0x556974e719fc - <unknown>
   8:     0x556974e719d1 - <unknown>
   9:     0x556974bead12 - <unknown>
  10:     0x556974beafb2 - <unknown>
  11:     0x556974cd7554 - <unknown>
  12:     0x556974cd3e0c - <unknown>
  13:     0x556974c81686 - <unknown>
  14:     0x556974cde9aa - <unknown>
  15:     0x556974cc491d - <unknown>
  16:     0x556974cde455 - <unknown>
  17:     0x7f795214bd90 - <unknown>
  18:     0x7f795214be40 - __libc_start_main
  19:     0x556974bfed4e - <unknown>
  20:                0x0 - <unknown>

vs.

gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep -E '^.*keys.*$'
org.gnome.settings-daemon.plugins.media-keys active true
org.gnome.settings-daemon.plugins.media-keys area-screenshot ['Print']
org.gnome.settings-daemon.plugins.media-keys area-screenshot-clip ['<Shift>Print']
org.gnome.settings-daemon.plugins.media-keys battery-status ['']
org.gnome.settings-daemon.plugins.media-keys battery-status-static ['XF86Battery']
org.gnome.settings-daemon.plugins.media-keys calculator ['']
org.gnome.settings-daemon.plugins.media-keys calculator-static ['XF86Calculator']
org.gnome.settings-daemon.plugins.media-keys control-center ['']
org.gnome.settings-daemon.plugins.media-keys control-center-static ['XF86Tools']
org.gnome.settings-daemon.plugins.media-keys custom-keybindings ['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/budgie-show-files-test/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/budgie-show-desktop/']
org.gnome.settings-daemon.plugins.media-keys decrease-text-size ['']
org.gnome.settings-daemon.plugins.media-keys eject ['']
org.gnome.settings-daemon.plugins.media-keys eject-static ['XF86Eject']
org.gnome.settings-daemon.plugins.media-keys email ['']
org.gnome.settings-daemon.plugins.media-keys email-static ['XF86Mail']
org.gnome.settings-daemon.plugins.media-keys help ['', '<Super>F1']
org.gnome.settings-daemon.plugins.media-keys hibernate ['']
org.gnome.settings-daemon.plugins.media-keys hibernate-static ['XF86Suspend', 'XF86Hibernate']
org.gnome.settings-daemon.plugins.media-keys home ['<Super>e']
org.gnome.settings-daemon.plugins.media-keys home-static ['XF86Explorer']
org.gnome.settings-daemon.plugins.media-keys increase-text-size ['']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-down ['']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-down-static ['XF86KbdBrightnessDown']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-toggle ['']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-toggle-static ['XF86KbdLightOnOff']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-up ['']
org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-up-static ['XF86KbdBrightnessUp']
org.gnome.settings-daemon.plugins.media-keys logout ['<Control><Alt>Delete']
org.gnome.settings-daemon.plugins.media-keys magnifier ['<Alt><Super>8']
org.gnome.settings-daemon.plugins.media-keys magnifier-zoom-in ['<Alt><Super>equal']
org.gnome.settings-daemon.plugins.media-keys magnifier-zoom-out ['<Alt><Super>minus']
org.gnome.settings-daemon.plugins.media-keys max-screencast-length uint32 30
org.gnome.settings-daemon.plugins.media-keys media ['']
org.gnome.settings-daemon.plugins.media-keys media-static ['XF86AudioMedia']
org.gnome.settings-daemon.plugins.media-keys mic-mute ['']
org.gnome.settings-daemon.plugins.media-keys mic-mute-static ['XF86AudioMicMute']
org.gnome.settings-daemon.plugins.media-keys next ['']
org.gnome.settings-daemon.plugins.media-keys next-static ['XF86AudioNext', '<Ctrl>XF86AudioNext']
org.gnome.settings-daemon.plugins.media-keys on-screen-keyboard ['']
org.gnome.settings-daemon.plugins.media-keys pause ['']
org.gnome.settings-daemon.plugins.media-keys pause-static ['XF86AudioPause']
org.gnome.settings-daemon.plugins.media-keys play ['']
org.gnome.settings-daemon.plugins.media-keys play-static ['XF86AudioPlay', '<Ctrl>XF86AudioPlay']
org.gnome.settings-daemon.plugins.media-keys playback-forward ['']
org.gnome.settings-daemon.plugins.media-keys playback-forward-static ['XF86AudioForward']
org.gnome.settings-daemon.plugins.media-keys playback-random ['']
org.gnome.settings-daemon.plugins.media-keys playback-random-static ['XF86AudioRandomPlay']
org.gnome.settings-daemon.plugins.media-keys playback-repeat ['']
org.gnome.settings-daemon.plugins.media-keys playback-repeat-static ['XF86AudioRepeat']
org.gnome.settings-daemon.plugins.media-keys playback-rewind ['']
org.gnome.settings-daemon.plugins.media-keys playback-rewind-static ['XF86AudioRewind']
org.gnome.settings-daemon.plugins.media-keys power ['']
org.gnome.settings-daemon.plugins.media-keys power-static ['XF86PowerOff']
org.gnome.settings-daemon.plugins.media-keys previous ['']
org.gnome.settings-daemon.plugins.media-keys previous-static ['XF86AudioPrev', '<Ctrl>XF86AudioPrev']
org.gnome.settings-daemon.plugins.media-keys priority 0
org.gnome.settings-daemon.plugins.media-keys rfkill ['']
org.gnome.settings-daemon.plugins.media-keys rfkill-bluetooth ['']
org.gnome.settings-daemon.plugins.media-keys rfkill-bluetooth-static ['XF86Bluetooth']
org.gnome.settings-daemon.plugins.media-keys rfkill-static ['XF86WLAN', 'XF86UWB', 'XF86RFKill']
org.gnome.settings-daemon.plugins.media-keys rotate-video-lock ['']
org.gnome.settings-daemon.plugins.media-keys rotate-video-lock-static ['<Super>o']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-cycle ['']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-cycle-static ['XF86MonBrightnessCycle']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-down ['']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-down-static ['XF86MonBrightnessDown']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-up ['']
org.gnome.settings-daemon.plugins.media-keys screen-brightness-up-static ['XF86MonBrightnessUp']
org.gnome.settings-daemon.plugins.media-keys screencast ['<Ctrl><Shift><Alt>R']
org.gnome.settings-daemon.plugins.media-keys screenreader ['<Alt><Super>s']
org.gnome.settings-daemon.plugins.media-keys screensaver ['<Alt><Super>l']
org.gnome.settings-daemon.plugins.media-keys screensaver-static ['XF86ScreenSaver']
org.gnome.settings-daemon.plugins.media-keys screenshot @as []
org.gnome.settings-daemon.plugins.media-keys screenshot-clip ['<Ctrl>Print']
org.gnome.settings-daemon.plugins.media-keys search ['']
org.gnome.settings-daemon.plugins.media-keys search-static ['XF86Search']
org.gnome.settings-daemon.plugins.media-keys stop ['']
org.gnome.settings-daemon.plugins.media-keys stop-static ['XF86AudioStop']
org.gnome.settings-daemon.plugins.media-keys suspend ['']
org.gnome.settings-daemon.plugins.media-keys suspend-static ['XF86Sleep']
org.gnome.settings-daemon.plugins.media-keys terminal ['<Primary><Alt>t']
org.gnome.settings-daemon.plugins.media-keys toggle-contrast ['']
org.gnome.settings-daemon.plugins.media-keys touchpad-off ['']
org.gnome.settings-daemon.plugins.media-keys touchpad-off-static ['XF86TouchpadOff']
org.gnome.settings-daemon.plugins.media-keys touchpad-on ['']
org.gnome.settings-daemon.plugins.media-keys touchpad-on-static ['XF86TouchpadOn']
org.gnome.settings-daemon.plugins.media-keys touchpad-toggle ['']
org.gnome.settings-daemon.plugins.media-keys touchpad-toggle-static ['XF86TouchpadToggle', '<Ctrl><Super>XF86TouchpadToggle']
org.gnome.settings-daemon.plugins.media-keys volume-down ['']
org.gnome.settings-daemon.plugins.media-keys volume-down-precise ['']
org.gnome.settings-daemon.plugins.media-keys volume-down-precise-static ['<Shift>XF86AudioLowerVolume', '<Ctrl><Shift>XF86AudioLowerVolume']
org.gnome.settings-daemon.plugins.media-keys volume-down-quiet ['']
org.gnome.settings-daemon.plugins.media-keys volume-down-quiet-static ['<Alt>XF86AudioLowerVolume', '<Alt><Ctrl>XF86AudioLowerVolume']
org.gnome.settings-daemon.plugins.media-keys volume-down-static ['XF86AudioLowerVolume', '<Ctrl>XF86AudioLowerVolume']
org.gnome.settings-daemon.plugins.media-keys volume-mute ['']
org.gnome.settings-daemon.plugins.media-keys volume-mute-quiet ['']
org.gnome.settings-daemon.plugins.media-keys volume-mute-quiet-static ['<Alt>XF86AudioMute']
org.gnome.settings-daemon.plugins.media-keys volume-mute-static ['XF86AudioMute']
org.gnome.settings-daemon.plugins.media-keys volume-step 6
org.gnome.settings-daemon.plugins.media-keys volume-up ['']
org.gnome.settings-daemon.plugins.media-keys volume-up-precise ['']
org.gnome.settings-daemon.plugins.media-keys volume-up-precise-static ['<Shift>XF86AudioRaiseVolume', '<Ctrl><Shift>XF86AudioRaiseVolume']
org.gnome.settings-daemon.plugins.media-keys volume-up-quiet ['']
org.gnome.settings-daemon.plugins.media-keys volume-up-quiet-static ['<Alt>XF86AudioRaiseVolume', '<Alt><Ctrl>XF86AudioRaiseVolume']
org.gnome.settings-daemon.plugins.media-keys volume-up-static ['XF86AudioRaiseVolume', '<Ctrl>XF86AudioRaiseVolume']
org.gnome.settings-daemon.plugins.media-keys window-screenshot ['<Alt>Print']
org.gnome.settings-daemon.plugins.media-keys window-screenshot-clip ['<Ctrl><Alt>Print']
org.gnome.settings-daemon.plugins.media-keys www ['']
org.gnome.settings-daemon.plugins.media-keys www-static ['XF86WWW']


@Manamama
Copy link

FYI, I have fed
cat src-tauri/src/app/setup.rs
to ChatGPT itself and it suggested:

It looks like the register method of the GlobalShortcutManager is being called within an if block that checks whether the GlobalShortcut is registered. If the GlobalShortcut is registered, the register method is called again, which is causing the error "called Result::unwrap() on an Err value: GlobalShortcut(InvalidAccelerator(...))".

To fix this, you can modify the code as follows:

let mut shortcut = app.global_shortcut_manager();
let core_shortcut = shortcut.register("CmdOrCtrl+Shift+O", move || {
    if let Some(w) = handle.get_window("core") {
        if w.is_visible().unwrap() {
            w.hide().unwrap();
        } else {
            w.show().unwrap();
            w.set_focus().unwrap();
        }
    }
});

if let Err(e) = core_shortcut {
    info!("Error registering global shortcut: {}", e);
}

This way, the register method is only called once and the error is handled by logging it, rather than calling unwrap on the Result returned by the register method.

@lencx
Copy link
Owner

lencx commented Dec 30, 2022

@Manamama Thank you, because I was in a hurry, I used unwrap for a lot of code and didn't do error handling and logging. I will improve them in the coming time.

@Manamama
Copy link

You are welcome.

FYI, (Shift+)Alt+O in e.g. the Polish keyboard layout is the default for ó/Ó - it may be getting in the way as well.

@lencx
Copy link
Owner

lencx commented Dec 30, 2022

@Manamama I will modify it to the configuration, which can be seen in the discussion here #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants