Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4680

4.1 TCK Failure: Spec1396IT#testViewScopedWebsocket

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2.15, 2.3.10, 2.3-next-M8, 4.0.0, 4.1.0-RC2
    • None
    • None
    • None

    Description

      The app expects "pushed!" to display when the "push" button is pressed.  It is not, and the test fails.

      Ajax requests do not occur when they are registered a websocket tag, from what I could gather. It seems like the renderAjaxOutput behavior isn't registered / called with the faces.push.init script.

      MyFaces generated code (see behavior param (1) – second to last):

      faces.push.init('j_id_c','/test-faces23-websocket/jakarta.faces.push/view?76379b861759b95fa70c118d2e05d29f','view',function(){document.getElementById('opened').innerHTML='yes';},null,null,null,{renderAjaxOutput:[function(event){myfaces.ab('j_id_c',event,'renderAjaxOutput','','ajaxOutput')}]},true);

      Facelet: https://github.com/jakartaee/faces/blob/4.1.0-RELEASE/tck/faces23/websocket/src/main/webapp/spec1396ViewScopedWebsocket.xhtml#L39

              <f:websocket channel="view" scope="view" onopen="function(){document.getElementById('opened').innerHTML='yes';}">
                  <f:ajax event="renderAjaxOutput" render="ajaxOutput" />
              </f:websocket>

      Link to Test: https://github.com/jakartaee/faces/blob/4.1.0-RELEASE/tck/faces23/websocket/src/test/java/ee/jakarta/tck/faces/test/javaee8/websocket/Spec1396IT.java#L94

      I test the same TCK app on Mojarra, and it sends out two XHR requests when the button is clicked. One for the button click and another for the renderAjaxOutput event. 

      MyFaces only handles the one XHR for the button click. Neither do I see the onMessage invoked, which per the javadoc should trigger the behavior ( "behavior param: Client behavior functions to be invoked when specific message is received.")?

      Docs:

      1) https://jakarta.ee/specifications/faces/4.0/jsdoc/faces.push

      Attachments

        1. image-2024-10-17-21-20-41-622.png
          15 kB
          Werner Punz
        2. image-2024-10-17-21-21-22-229.png
          134 kB
          Werner Punz
        3. image-2024-10-21-22-04-40-993.png
          481 kB
          Werner Punz
        4. screenshot-1.png
          192 kB
          Werner Punz
        5. screenshot-2.png
          143 kB
          Werner Punz
        6. test-faces23-websocket.war
          10 kB
          Volodymyr Siedlecki

        Activity

          People

            volosied Volodymyr Siedlecki
            volosied Volodymyr Siedlecki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: