glowing-bear / glowing-bear

A web client for WeeChat
https://www.glowing-bear.org
GNU General Public License v3.0
951 stars 177 forks source link

weechat 4.3.0 introduced websocket permessage-deflate which causes handshake failure in Safari #1280

Open meldra opened 4 months ago

meldra commented 4 months ago

This was discussed in the IRC channel last night and in the weechat channel today.

@flashcode advised I try /set relay.network.compression 0 which did mitigate the failure in 4.3.x

For the current git version he has added /set relay.network.websocket_permessage_deflate which when toggled to off just toggles off permessage_deflate instead of all compression.

For now it would probably be good to have a notice targeted to Safari users informing them to set the settings, instead of the <2.9 advice that is currently given.

He's hoping to find a solution that will work without people having to set options, so if you have other ideas I'm sure he'd appreciate them.

edit: the error message in weechat is =!= | relay: error decoding websocket frame for client

meldra commented 4 months ago

Also, while this would previously possibly have been fixable in the same way #1199 was, it appears that Apple in their infinite wisdom decided that this is cannot stand, and you can no longer do that as of recent Safari versions.

flashcode commented 4 months ago

Hi,

I just realized there's a double compression in "weechat" relay protocol: the protocol itself compresses binary messages sent to the client (option relay.network.compression), and as permessage-deflate is enabled, websocket frames are also compressed on top of this.

As "weechat" protocol is going to be deprecated and even removed in future, I'll disable permessage-deflate there (and keep it only in the new "api" relay), this will prevent such regressions with browsers.

This fix will be released in version 4.3.2.

flashcode commented 4 months ago

This is fixed in weechat, branches master (4.4.0-dev) and 4.3 (future 4.3.2).

Please test one of these branches (or both) to confirm if the fix is OK with Safari.

Note: the new option relay.network.websocket_permessage_deflate in 4.4.0-dev now only applies to "api" relay, so even if it's enabled (default value), permessage-deflate is not enabled with "weechat" protocol, even if the client (browser) supports it.

meldra commented 4 months ago

Please test one of these branches (or both) to confirm if the fix is OK with Safari.

tested and confirmed working for 4.4.0-dev

flashcode commented 4 months ago

A test on branch 4.3 is welcome as well, so I can release 4.3.2 soon to fix the issue.

meldra commented 4 months ago

A test on branch 4.3 is welcome as well, so I can release 4.3.2 soon to fix the issue.

Wiped old profile, checked out 4.3, built again.

WeeChat 4.3.2-dev [compiled on Jun 4 2024 13:36:00] works without changing the configs

flashcode commented 4 months ago

@meldra: thanks for testing!

flashcode commented 3 months ago

FYI, WeeChat 4.3.2 has just been released.