aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch')
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch b/nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch
new file mode 100644
index 00000000000..bc000ba9cca
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch
@@ -0,0 +1,26 @@
+diff --git server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
+index 6cb70cf0..0c3789cd 100644
+--- server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
++++ server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
+@@ -45,7 +45,7 @@ import GHC.AssertNF
+ import qualified ListT
+ import qualified Network.WebSockets as WS
+ import qualified StmContainers.Map as STMMap
+-import qualified System.IO.Error as E
++--import qualified System.IO.Error as E
+
+ import qualified Hasura.Logging as L
+
+@@ -287,12 +287,6 @@ createServerApp (WSServer logger@(L.Logger writeLog) serverStatus) wsHandlers !p
+ let rcv = forever $ do
+ -- Process all messages serially (important!), in a separate thread:
+ msg <- liftIO $
+- -- Re-throw "receiveloop: resource vanished (Connection reset by peer)" :
+- -- https://github.com/yesodweb/wai/blob/master/warp/Network/Wai/Handler/Warp/Recv.hs#L112
+- -- as WS exception signaling cleanup below. It's not clear why exactly this gets
+- -- raised occasionally; I suspect an equivalent handler is missing from WS itself.
+- -- Regardless this should be safe:
+- handleJust (guard . E.isResourceVanishedError) (\()-> throw WS.ConnectionClosed) $
+ WS.receiveData conn
+ writeLog $ WSLog wsId (EMessageReceived $ TBS.fromLBS msg) Nothing
+ _hOnMessage wsHandlers wsConn msg