llaske / sugarizer

Sugarizer is a web implementation of the Sugar platform to run on any device or browser
https://sugarizer.org
Apache License 2.0
198 stars 411 forks source link

Loading error on slow network #1048

Closed MananJain777 closed 1 year ago

MananJain777 commented 2 years ago

It happened few times with me like whenever I play a certain game it just doesn't respond at all and to fix it I need to restart the website and re-login which isn't a good user experience.

https://user-images.githubusercontent.com/96513500/160713419-83426768-325d-47dd-b386-b4a01fdeaaf1.mp4

AnandChourasia007 commented 2 years ago

Hey @MananJain777 , it would be helpful if you could tell us how to reproduce this issue because Memorize is working fine on my computer.

Shreyas-SAS commented 2 years ago

whenever I play a certain game it just doesn't respond at all.

@MananJain777 Can you tell me once whether you are facing the problem with local file being run in a browser or using the try sugarizer web app on the website?

If its local file that is being run resulting an error then I had faced a similar scenario whenever I tried to launch Sugarizer in presence of another chrome tab/window (with or without the same account).

Please try to relaunch sugarizer after closing all chrome instances. If the issue persists please inform us. We will try best to resolve the issue.

MananJain2002 commented 2 years ago

Hi @AnandChourasia007 I don't know sometimes that error occurs sometimes it won't. It happened three times for me. I guess it might be cause of backend issues server might not be loading fast enough...

MananJain2002 commented 2 years ago

@Shreyas-SAS I am using it on the website https://try.sugarizer.org/ as well as https://dev.sugarizer.org/ we can improve some backend code for it to render properly...

Shreyas-SAS commented 2 years ago

@Shreyas-SAS I am using it on the website https://try.sugarizer.org/ as well as https://dev.sugarizer.org/ we can improve some backend code for it to render properly...

@MananJain2002 Change in Backend? I still don't get it what exactly seems to be the error caused. Can you please explain when the error is occurring, its not showing up at our ends.

It might also be that there may be a network issue or browser issue at the moment and no problem with the code.

If you feel that there is a problem with the code, feel free to put up a PR. We will surely have a look and suggest if we feel any change is necessary.

MananJain2002 commented 2 years ago

@Shreyas-SAS it happened like three times for me with different wifi connections I don't think network is the problem and it occures sometimes and I thought it might be because the code is not rendering properly on the site might need to use some async/await and promises from javascript so that it can load properly surely I'll go through the code and try to figure out something if found will post a PR

llaske commented 2 years ago

@MananJain2002 It look like a connection issue. Please display the console/error window to see if there is any error.

MananJain2002 commented 2 years ago

Hi @llaske sir, it just happened once again with me this morning as you can see in the log its not a connection error its a promise error my guess would be its not rendering the files faster enough which we can improve by changing a bit of javascript code at the backend

https://user-images.githubusercontent.com/63538502/160959524-b946fa9f-e80e-477d-8c59-c782dfe9eb84.mp4

It happened in incognito mode as well

https://user-images.githubusercontent.com/63538502/160959583-51f508dc-4c26-4b03-869b-7f0c897d4d1c.mp4

If you allow me I would like to look around the code and update it. Once I figure it out I'll make a pull request

llaske commented 2 years ago

Please record the console and the network trace from the Sugarizer home page. We can't deduce anything from your current record. The same error could happen if you force stop the loading of the activity in the browser. There is no Javascript code on the backend.

MananJain2002 commented 2 years ago

@llaske sir as you can see home page is loading fine but when I click on the game it doesn't load due to timeout error

https://user-images.githubusercontent.com/63538502/161180845-1601c85a-5dea-4511-840d-7777bed6b8e1.mp4

llaske commented 2 years ago

I've reproduced the issue by forcing network throttling to "Slow 3G". There is a timeout when reading some files. There is nothing we could do about that, minimizing could reduce a bit the issue but there is physical limit (time vs file size). It's why it's so important to provide an offline version of Sugarizer for PC and tablet.

MananJain2002 commented 2 years ago

Hi @llaske sir I made a pull request please review it #1069

MananJain2002 commented 2 years ago

Oops mistakenly I have made a pull request with master branch. I have made another pull request on dev branch here #1070 please review it.