<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>204237</bug_id>
          
          <creation_ts>2019-11-15 11:18:05 -0800</creation_ts>
          <short_desc>REGRESSION (Safari 13): Websocket cannot send large frames</short_desc>
          <delta_ts>2019-11-22 09:32:22 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>202401</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=202401</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>berkus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>ap</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1590563</commentid>
    <comment_count>0</comment_count>
    <who name="">berkus</who>
    <bug_when>2019-11-15 11:18:05 -0800</bug_when>
    <thetext>Possibly in relation with https://bugs.webkit.org/show_bug.cgi?id=170463 but posting a new bug.

Safari 13 both on macOS Catalina and iOS 13.2 fails to send large websocket frames.

In our testing, sending frames under 1k to a Twilio-specific connection works fine, but after sending a few large frames (about 32k each) the connection fails with

WebSocket connection to &apos;wss://tsock.us1.twilio.com/v3/wsconnect&apos; failed: Failed to compress frame
WebSocket connection to &apos;wss://tsock.us1.twilio.com/v3/wsconnect&apos; failed: Failed to send WebSocket frame.

This is a REGRESSION because the same sequence works well in Safari 12 with all the other configuration remaining the same.

I don&apos;t have a minimal example in itself, since we&apos;re using Twilio Chat quickstart to test. Just sending frames through websocket in one direction does not seem to trigger that error.

However there&apos;s a copy of the quickstart repository that contains all necessary information to start testing.

1. Grab the repository from here: https://github.com/berkus/twilio-chat-quickstart-safari13-repro/tree/safari13-repro

2. In public/chat/index.js find the text INSERT_URL_HERE and replace it with the token generator url which has already been preconfigured for you: https://aquamarine-cichlid-8646.twil.io/token?key=_aapl_repro98767542432

3. Run `npm install` and start the server using `node run start`

4. Navigate Safari to localhost:3000/chat

5. It will try to fetch and paginate approximately 600 channels and at some point you will see a NOT_ACCEPTABLE_MESSAGE response from our websocket server. At the same point there will be &quot;Failed to compress frame&quot; message in the console log.

Please note that NOT_ACCEPTABLE_MESSAGE is the response of our server due to break of protocol between server and client (client attempts a reconnection) - and that happens because of the failure of Safari to compress and send a frame. This is a REGRESSION in Safari 13 and it works properly in Safari 12.

We will be happy to assist with debugging this issue further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1590571</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-11-15 11:23:21 -0800</bug_when>
    <thetext>&lt;rdar://problem/57234281&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1590574</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-11-15 11:25:48 -0800</bug_when>
    <thetext>Could be same as bug 202401, but needs further analysis to confirm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1590577</commentid>
    <comment_count>3</comment_count>
    <who name="">berkus</who>
    <bug_when>2019-11-15 11:31:44 -0800</bug_when>
    <thetext>Looks very similar indeed, I will check if the &quot;x-webkit-deflate-frame extension&quot; is enabled for us.

Can it be force-disabled from the server-side somehow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1592030</commentid>
    <comment_count>4</comment_count>
    <who name="">berkus</who>
    <bug_when>2019-11-20 09:41:45 -0800</bug_when>
    <thetext>We have force-disabled support for &quot;x-webkit-deflate-frame&quot; extension on the server side. This seems to work around the problem for the time being.

I hope to see actual working permessage-deflate support in WebKit at some point in time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1592843</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-11-22 09:32:22 -0800</bug_when>
    <thetext>Based on this, marking as a duplicate of bug 202401.

*** This bug has been marked as a duplicate of bug 202401 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>