Bug #2603
closedRestart confirmation after quit() may not work as intended
0%
Description
The quit() documentation recommends using a redirect() or displaying non-clickable content after quit(). The Wt examples follow this pattern.
However, there is code in Wt.js to display a prompt: "The application was quited, do you want to restart?", that seems like it might be helpful for some use cases. In particular, if an application maintains sufficient state in its internal path and implements a user-defined session timeout with quit() via notify(), this seems like a mechanism that could enable users to continue working across a quit() with less disruption than a redirect.
If this is an intended use case, it does not appear to be working in the latest github version 3.3.1-24-gbd44598. I've attached a sample program (with an associated wt_config.xml to reduce the time needed for the test). The sample can quit() in response to either a button press or a timeout. In both cases, the prompt to restart does not appear.
I've also attached a patch which (re-)enables the restart prompt for these cases --- which I suspect is the intent. The patch has only been lightly tested.
If this is not an intended use case, your feedback would be very welcome!
Files
Updated by Bruce Toll almost 11 years ago
I did some more testing and noted that the above patch does not work correctly with websockets enabled. The restart prompt appears without any user action after quit(). In any case, a user without Javascript would get no indication that the session had been timed-out relying on this approach.
It makes sense to follow the documented recommendations!
Updated by Bruce Toll almost 11 years ago
As a follow-up, I found that Wt was able to provide very good results for this use case without modification. I ended-up displaying a WDialog with some text and a large WPushButton configured with setLink(bookmarkUrl()) prior to quit().
Updated by Koen Deforche almost 11 years ago
- Status changed from New to Resolved
- Target version set to 3.3.2
Hey,
You're right about the intent and the patch to rectify this; the only thing missing was with WebSockets to also take into account quited when trying to auto reconnect.
I've fixed
Regards,
koen
Updated by Koen Deforche almost 11 years ago
- Status changed from Resolved to Closed