scratchattach icon indicating copy to clipboard operation
scratchattach copied to clipboard

feat: check scratch cloud status

Open usertermed opened this issue 2 months ago • 6 comments

Currently when scratch cloud is down it outputs a cryptic error. Ideally, it should ping cloud data server to check if its up and tell the user.

usertermed avatar Nov 04 '25 20:11 usertermed

There is a principle called "It's easier to ask for forgiveness than permission", that would be violated this way. It would also slow down start-up time.

TheCommCraft avatar Nov 05 '25 06:11 TheCommCraft

Unless you mean after there is an error, but afaik it is possible to tell why it is failing by inspecting the error. Are you suggesting to improve errors?

TheCommCraft avatar Nov 05 '25 06:11 TheCommCraft

I think maybe we could add a suggestion that the cloud server may be down instead of giving a 'cryptic' error (about websockets). In addition, we maybe could make some kind of badge on the README/webpage (maybe using vercel) to show the status of the scratch cloud.

I'm not sure if this would work (maybe check next time cloud vars are down). Also, if we want to make this a zero-cost check, you can check for cloud vars being down only if you get a websocket (handshake) error. This way, it has no cost most of the time (although that cost is probably negligible anyway).

I do think it may be worth trying to make this issue more clear because there is a significant portion of issues related to the scratch cloud being down, which, if we added this as an error message, would not be so common.

faretek1 avatar Nov 05 '25 19:11 faretek1

there could be a sa.check_cloud_status() method that allows scratchattach users to get the current status of scratch's cloud var

TimMcCool avatar Nov 14 '25 16:11 TimMcCool

the url I linked is now giving 502 bad gateway. if cloud is down, then i think it can be used

faretek1 avatar Nov 14 '25 17:11 faretek1

there could be a sa.check_cloud_status() method that allows scratchattach users to get the current status of scratch's cloud var

that could be used internally for the error message too

faretek1 avatar Nov 14 '25 17:11 faretek1

https://scratch.mit.edu/projects/1240769388/

This project uses Scratchattach to test cloud variables. It connects to the server, changes a variable, and if the server sees one, sends a change in response. If your device sees the change, it will know it is online. I have tested this and it has very high accuracy. (I created it on another account)

MilesWK avatar Nov 20 '25 16:11 MilesWK

**Update: **

This could work! Scratch cloud just came back online for a brief moment and I checked the server and got this response

Image

You could make a very simple request to it and if you get a response, show online. However, this server seems REALLY patchy. I reload 10 times and only 3 of those show a response.

MilesWK avatar Nov 20 '25 16:11 MilesWK

I just made a pull request with this function added to scratchattach

MilesWK avatar Nov 20 '25 17:11 MilesWK

there is now a function to fetch the cloud status. this dhould be called in the error printer for this error. however do note that this status checker is only for scratch cloud

faretek1 avatar Nov 20 '25 19:11 faretek1

That's really not an issue, as Turbowarp Cloud has never had major issues like scratch has.

MilesWK avatar Nov 20 '25 19:11 MilesWK

fixed by #536

usertermed avatar Nov 29 '25 19:11 usertermed