Azure-Agst / decky-syncthing

Syncthing frontend for Decky
GNU General Public License v3.0
2 stars 0 forks source link

Broken on SteamOS Stable channel? #3

Closed krompus closed 2 weeks ago

krompus commented 7 months ago

I think the SteamOS 3.5 Stable update may have broken this plugin. I've got Syncthing GTK functioning and connected to Syncthing daemon, followed the instructions here:

https://old.reddit.com/r/SteamDeck/comments/vocyi5/start_syncthing_automatically_on_steamdeck_even/

The default port was 8081, so there's no conflict with CEF Remote Debugging's 8080, and I've even manually changed the port to 8384 to match this plugin's default.

DEBUG INFORMATION

Current Process State

State: !!! failed loading: TypeError: Failed to fetch

Show Current Log is empty, just the LOG (USE TOUCH TO SCROLL) at the top and then a blank page.

I am able to navigate to 127.0.0.1:8384 in a web browser within Game Mode and see that Syncthing is connected and Up to Date, and file syncing is also functioning in Game Mode,

kylernocturnalnerd commented 6 months ago

I also encounter this.

Azure-Agst commented 6 months ago

Oh, my bad! I didn't realize people even used this, considering it wasn't in the main repo.

I'll look into this when I get the chance. Sorry for the delay!

kylernocturnalnerd commented 6 months ago

Oh, my bad! I didn't realize people even used this, considering it wasn't in the main repo.

I'll look into this when I get the chance. Sorry for the delay!

Its all good. thanks for the work. Ive been using my browser with a bookmark as a workaround and it seemed fine.

Azure-Agst commented 6 months ago

Hm, after some basic testing, I was unable to recreate the issue. For context, I'm running SteamOS 3.5.7, Syncthing GTK v0.9.4.5, and a freshly compiled version of the plugin.

After looking at the code, I've found that there is already code handling a similar error in the project, which only appears when authorization with the Syncthing daemon fails. From fetch.ts:

// Notably, CORS headers are missing from 403 Forbidden responses
// This causes a generic TypeError to be raised, which we can handle
if (e instanceof TypeError && /Failed to fetch/.test(e.message))
    throw new Error("Bad Authorization!");

I guess that error handling isn't working properly? Notably, also in that file is a hardcoded string that appends the http:// protocol to your host.

// Get request
const result = await fetch(`http://${Settings.host}${endpoint}`, {
    headers: {
        "X-API-Key": Settings.apiKey
    }
})

Out of a hunch, might I ask what exactly the host is set to in your settings? I have a feeling that it could be doubling up the protocols and causing some weird auth issues.

ThePerfectVale commented 3 weeks ago

Hi! Same issue here. I am running on SteamOS 3.5.19 and Syncthing version 0.9.4.5, configured it to run on boot in desktop and game mode. The logs are empty, and the only error I see is "State: !!! failed loading: TypeError: Failed to fetch" A few interesting things I've noticed though, pressing the web button in the plugin always brings me to 127.0.0.1:58384, even if I set my port to be 8081 (my SyncThing was running on that port and was set as such in the plugin settings). I changed it to 58384, which makes the web button work properly, but the plugin still gives the same error.