Add auto-logout/save after long period of inactivity
If leaving the BlocklyProp editor open for a while (with an existing program displayed, in this case), selecting to Compile or Load displays a NAN message.

I believe the real problem is that the user was automatically logged out between the last successful use and now, as navigating to the home screen, logging in, and opening the same program again works properly.
Messages like "NAN" do nothing to inform the user of the actual problem. We need BlocklyProp to trap this kind of error, determine the actual cause, and display a friendly message that leads the user to the solution. Such as "Can not compile because your account is logged out. Please log in and try again." in this case.
This issue may also be related to Issue #420.
[Update from Educator's Course use]
From @kgracey -
This error came up for about 25% of BlocklyProp users after lunch. While they were actively using Blockly in the morning this error didn’t occur. When they left for lunch and returned they were still logged in. Creating a new program caused this error. They fixed it by closing out, logging in again.
This just happened to me as well. I had the window open with a few blocks in place, then we had an internet outage. The connection returned, and I continued to build a complex program. It would not compile and gave me the NAN message. I selected Save, which appeared to work, and Save As, and renamed my program. However, I got a message to log in, and my code was not saved either under the old name nor the new. Bummer.
Can we check for a valid login before sending a job off to the cloud compiler? Or intercept the error from the cloud compiler and determine the login state?
In my case, I understand that a loss of internet service logged me out, not Blockly. However, it seems weird that I should be able to continue to edit the code for a good while and apparently save it, when I was not logged in and could not actually save it. I would not have bothered doing all that work I lost if I knew I could not save it.
In the situation where Blockly intends to log out due to inactivity, would it be possible to have a message say "Are you still there? Logging out in X minutes...save or compile your work to stay logged in." or some such thing. And I also notice that my login name is visible in some windows, but not in block or C code windows. I'd appreciate anything to alert me that I'm not logged in even though I didn't leave this window and I can apparently build and (not really!) save, so I don't waste time building code I can't use or save.
Great examples and feedback... exactly the kind of thing I've been frustrated with for quite some time.
Manipulating blocks on the canvas is an activity that happens in the client browser. There is no communication with the servers during the design phase. We can avoid this with a keep-alive connection to the server. But that means more client-side code.
Fair enough. Some form of visual indication of login status while in the block edit window would be quite helpful. And/or at least when I try to Save, it should warn me that I'm not logged in so I can at least screencap instead of thinking I"ve saved and then navigating away, only to discover it's all gone for good.
Stephanie Lindsay Product & Docs Manager Parallax Inc.
916-625-3077 www.parallax.com learn.parallax.com
On Tue, Oct 25, 2016 at 2:15 PM, Jim Ewald [email protected] wrote:
Manipulating blocks on the canvas is an activity that happens in the client browser. There is no communication with the servers during the design phase. We can avoid this with a keep-alive connection to the server. But that means more client-side code.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/parallaxinc/BlocklyProp/issues/509#issuecomment-256178209, or mute the thread https://github.com/notifications/unsubscribe-auth/AVxRIvI2R4a3GDDm5K6tEdSrMT8X5c2tks5q3nF3gaJpZM4JjS9d .
Some thoughts on this:
What if we used a javascript function running on an interval that kept an eye on the cookie and/or connection status that determines when the user is logged-out/timed-out? I see this with my banking website (it gives you a warning like - "Hey, are you there? You are about to be logged out due to inactivity" - kind of thing) and then, if the connection is still live, automatically saves a copy of their current program with "my project (autosaved 2016-11-02 22:32:19)" as the new project name and then allows the log out to happen.
I think with some digging I could tackle parts of this...
That sounds very nice. I'd also request that if it knows they've been auto-logged out, it places a prompt on the screen, "You've been automatically logged out due to inactivity."
Closer to a solution here - now have a save reminder in place at the 20 minute mark - I can add the "you've been logged out" at the 59 minute mark once I find all of the possible server interactions that would reset that clock.
Cool - learn to save from the beginning! Hopefully, this will help develop a good habit.
In case it hasn't already been said: please make this feature only prompt the user if their project has been modified but not saved.
Yes, the warning only pops up when you've made a change and have not saved it.
On Aug 2, 2017 3:28 PM, "Parallax Git Administrator" < [email protected]> wrote:
In case it hasn't already been said: please make this feature only prompt the user if their project has been modified but not saved.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/parallaxinc/BlocklyProp/issues/509#issuecomment-319816395, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0quAbN5MSLkbeAERfHevr1lBgj4Krlks5sUPf2gaJpZM4JjS9d .
I think we lost track of the issue where Internet connectivity is lost and undetected. A temporary loss of connectivity should not be a problem because the session id is not immediately reset. The session id is the mechanism that determines if a user is logged in.
My suggestion is to implement a 'keep-alive' feature that will refresh the system timer at a regular interval. The exact interval determined after further evaluation.
@MatzElectronics Does the CDN code log out the user after a period of inactivity in the current code base? If so, we can close this issue.
Asking again, for a friend.
@MatzElectronics Does the CDN code log out the user after a period of inactivity in the current code base? If so, we can close this issue.