Project

General

Profile

Actions

Bug #2603

closed

Restart confirmation after quit() may not work as intended

Added by Bruce Toll over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
01/24/2014
Due date:
% Done:

0%

Estimated time:

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

test_quit_restart.C (2.26 KB) test_quit_restart.C Bruce Toll, 01/24/2014 11:46 PM
wt_config.xml (299 Bytes) wt_config.xml Bruce Toll, 01/24/2014 11:46 PM
0001-Restore-confirm-restart-after-quit-feature.patch (1.65 KB) 0001-Restore-confirm-restart-after-quit-feature.patch Bruce Toll, 01/24/2014 11:46 PM
Actions #1

Updated by Bruce Toll about 10 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!

Actions #2

Updated by Bruce Toll about 10 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().

Actions #3

Updated by Koen Deforche about 10 years ago

  • Assignee set to Koen Deforche
Actions #4

Updated by Koen Deforche about 10 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

Actions #5

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF