ICEfaces
  1. ICEfaces
  2. ICE-2919

Updates are occasionally not applied when using Ajax Push in portlets

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7RC1
    • Fix Version/s: 1.7
    • Component/s: Bridge, Framework
    • Labels:
      None
    • Environment:
      portal portlet ajax push

      Description

      Attached you will find a portle which is a sample that I developed for Liferay Portal that demonstrates inter-portlet communication with ICEfaces Ajax Push.

      Although it is only one .WAR, it contains two portlets: Customers and Bookings

      To reproduce the problems:

      1. Download and Install the Liferay 4.4.2 + Tomcat 6.0.16 bundle
      2. Run the bundle, which will create a $HOME/liferay/deploy folder
      3. Download the sample-icefaces-ipc-ajax-push-portlet.war attached to this ticket and copy to $HOME/liferay/deploy
      5. Start IE7
      6. Login as test@liferay.com with password test
      7. Position the mouse over the "Welcome" dock in the upper right hand corner
      8. Navigate to "My Places > My Community > Private Pages"
      9. Add a page named "IPC"
      10. Under the "Add Content" menu, expand the "Samples" category
      11. Add the "Sample ICEfaces IPC - Customers" portlet
      12. Under the "Add Content" menu, expand the "Samples" category
      13. Add the "Sample ICEfaces IPC - Bookings" portlet

      This isn't reproducible on demand. It often takes a bit of interaction but the basic problem is that if you click on the edit button for one of the customers and then interact with their booking information (open and collapse some panels) and then click on another customer's edit button, the UI is not properly updated. To get the update to occur, you can either:

      1) Click on the button again.
      2) Wait for the next heartbeat.

      Either one of these actions seems to get the updates properly applied to the UI.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Using Firebug, I noticed that the when the problem occurs, it appears that the entire lifecycle runs properly and the server-side rendering is applied but the updates that come back on the initial click or incorrect. Following is a snippet from the Firebug console:

        window.fE-T#2.async-connection.blocking [9298912] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/receive-updated-views (17419ms)

        [window] Focus Set on [_sample_icefaces_ipc_customers_portlet_WAR_lripc_INSTANCE_05iO_:_id2:_id7:1:_id9]

        window.fE-T#2.async-connection.ui [9489420] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/receive-updates (11ms)

        window.fE-T#2.async-connection.ui [9489420] : receive [200] OK

            • This is what is returned when the click appears not to work ***
              window.fE-T#2 applied update : <script id="fE-TrjKUzJdOM3KNfSkTgQ:2:dynamic-code" type="text/javascript">...</script>

        window.fE-T#2.async-connection.ui [9489420] : connection closed

        window.fE-T#2.async-connection.heartbeat ping

        window.fE-T#2.async-connection.ui [358255] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/ping (26ms)

        window.fE-T#2.async-connection.ui [358255] : receive [200] OK

        window.fE-T#2.async-connection.blocking [9298912] : receive [200] OK

        window.fE-T#2.async-connection closing previous connection...

        window.fE-T#2.async-connection.blocking [9298912] : connection closed

        window.fE-T#2.async-connection connect...

        window.fE-T#2.async-connection.blocking [482460] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/receive-updated-views

        window.fE-T#1.async-connection.ui [9027713] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/receive-updates (127ms)

        window.fE-T#2.async-connection.ui [6229389] : send asynchronous POST

        POST http://localhost:8080/lr-ipc/block/receive-updates (132ms)

        window.fE-T#1.async-connection.ui [9027713] : receive [200] OK

            • With a second click or waiting for the next heartbeat, eventually, the updates do get applied ***

        window.fE-T#1 applied update : <form action="iceSubmit('sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:id2');" class="iceFrm sample-icefaces-portlet" enctype="application/x-www-form-urlencoded" id="_sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:_id2" method="post" onsubmit="return false;">...</form>

        window.fE-T#1.script-loader evaluating script : 'sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:_id2'.asExtendedElement().captureAndRedirectSubmit();

        window.fE-T#1.async-connection.ui [9027713] : connection closed

        window.fE-T#2.async-connection.ui [6229389] : receive [200] OK

        window.fE-T#2.async-connection.heartbeat pong

        window.fE-T#2.async-connection.ui [6229389] : connection closed

        Show
        Deryk Sinotte added a comment - Using Firebug, I noticed that the when the problem occurs, it appears that the entire lifecycle runs properly and the server-side rendering is applied but the updates that come back on the initial click or incorrect. Following is a snippet from the Firebug console: window.fE-T#2.async-connection.blocking [9298912] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/receive-updated-views (17419ms) [window] Focus Set on [_sample_icefaces_ipc_customers_portlet_WAR_lripc_INSTANCE_05iO_:_id2:_id7:1:_id9] window.fE-T#2.async-connection.ui [9489420] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/receive-updates (11ms) window.fE-T#2.async-connection.ui [9489420] : receive [200] OK This is what is returned when the click appears not to work *** window.fE-T#2 applied update : <script id="fE-TrjKUzJdOM3KNfSkTgQ:2:dynamic-code" type="text/javascript">...</script> window.fE-T#2.async-connection.ui [9489420] : connection closed window.fE-T#2.async-connection.heartbeat ping window.fE-T#2.async-connection.ui [358255] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/ping (26ms) window.fE-T#2.async-connection.ui [358255] : receive [200] OK window.fE-T#2.async-connection.blocking [9298912] : receive [200] OK window.fE-T#2.async-connection closing previous connection... window.fE-T#2.async-connection.blocking [9298912] : connection closed window.fE-T#2.async-connection connect... window.fE-T#2.async-connection.blocking [482460] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/receive-updated-views window.fE-T#1.async-connection.ui [9027713] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/receive-updates (127ms) window.fE-T#2.async-connection.ui [6229389] : send asynchronous POST POST http://localhost:8080/lr-ipc/block/receive-updates (132ms) window.fE-T#1.async-connection.ui [9027713] : receive [200] OK With a second click or waiting for the next heartbeat, eventually, the updates do get applied *** window.fE-T#1 applied update : <form action="iceSubmit(' sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC : id2');" class="iceFrm sample-icefaces-portlet" enctype="application/x-www-form-urlencoded" id="_sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC :_id2" method="post" onsubmit="return false;">...</form> window.fE-T#1.script-loader evaluating script : ' sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC :_id2'.asExtendedElement().captureAndRedirectSubmit(); window.fE-T#1.async-connection.ui [9027713] : connection closed window.fE-T#2.async-connection.ui [6229389] : receive [200] OK window.fE-T#2.async-connection.heartbeat pong window.fE-T#2.async-connection.ui [6229389] : connection closed
        Hide
        Deryk Sinotte added a comment -

        Attaching sample portlet showing IPC via Ajax Push between two portlets in the same war.

        Show
        Deryk Sinotte added a comment - Attaching sample portlet showing IPC via Ajax Push between two portlets in the same war.
        Hide
        Mircea Toma added a comment -

        Append (instead of overwriting) new updated views into the shared cookie that holds the list of updated views.
        Refactor blocking connection code to send updated views, if available, on newly created requests.

        Show
        Mircea Toma added a comment - Append (instead of overwriting) new updated views into the shared cookie that holds the list of updated views. Refactor blocking connection code to send updated views, if available, on newly created requests.

          People

          • Assignee:
            Unassigned
            Reporter:
            Deryk Sinotte
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: