ICEfaces
  1. ICEfaces
  2. ICE-9027

ice.onSessionExpiry(callback) executed twice on session expiration

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Tomacat 7, Chrome, Firefox, IE
    • Assignee Priority:
      P2
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      The following snippet can be used instead to prevent double execution of the callback function:

       ice.onSessionExpiry(HandleExpireSession);
       var executed = false;

       function HandleExpireSession ()
       {
          if(!executed) {
              alert("This is a test");
              executed = true;
          }
       };
      Show
      The following snippet can be used instead to prevent double execution of the callback function:  ice.onSessionExpiry(HandleExpireSession);  var executed = false;  function HandleExpireSession ()  {     if(!executed) {         alert("This is a test");         executed = true;     }  };

      Description

      To reproduce:
      1. deploy attached sample application.
      2. Wait for 1 minute (for session to expire)
      3. Click on command button

      Outcome:


      the following JS will be executed twice:

      ice.onSessionExpiry(HandleExpireSession);
       
       function HandleExpireSession ()
       {
              alert("This is a test");
       };
       
       
      and result into double appearance of the alert box

        Activity

        Hide
        Mircea Toma added a comment -

        The session expired are registered twice, once with the global (per page) JSF error callbacks then with the per request callbacks.

        The applied fix wires the session expired callbacks only to the global error intercepting JSF callbacks.

        Show
        Mircea Toma added a comment - The session expired are registered twice, once with the global (per page) JSF error callbacks then with the per request callbacks. The applied fix wires the session expired callbacks only to the global error intercepting JSF callbacks.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Evgheni Sadovoi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: