packages feed

launchdarkly-server-sdk 4.4.0 → 4.4.1

raw patch · 4 files changed

+20/−6 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,14 @@  All notable changes to the LaunchDarkly Haskell Server-side SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [4.4.1](https://github.com/launchdarkly/haskell-server-sdk/compare/4.4.0...4.4.1) (2024-12-24)+++### Bug Fixes++* Fix SSE newline handling ([365340a](https://github.com/launchdarkly/haskell-server-sdk/commit/365340a978a12d2da97e9d7f7d421ae63ad954ea))+* Handle optional properties in data payload ([365340a](https://github.com/launchdarkly/haskell-server-sdk/commit/365340a978a12d2da97e9d7f7d421ae63ad954ea))+ ## [4.4.0](https://github.com/launchdarkly/haskell-server-sdk/compare/4.3.0...4.4.0) (2024-12-05)  This release introduces the ability to enable compression of event payloads. When enabled, the SDK will compress events before sending them to the LaunchDarkly servers. This can reduce the bandwidth required to send events, which can be useful in high-traffic environments to reduce egress traffic costs.
launchdarkly-server-sdk.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           launchdarkly-server-sdk-version:        4.4.0+version:        4.4.1 synopsis:       Server-side SDK for integrating with LaunchDarkly description:    Please see the README on GitHub at <https://github.com/launchdarkly/haskell-server-sdk#readme> category:       Web
src/LaunchDarkly/Server/Client/Internal.hs view
@@ -21,7 +21,7 @@  -- | The version string for this library. clientVersion :: Text-clientVersion = "4.4.0" -- x-release-please-version+clientVersion = "4.4.1" -- x-release-please-version  -- | -- Client is the LaunchDarkly client. Client instances are thread-safe.
src/LaunchDarkly/Server/Network/Streaming.hs view
@@ -3,7 +3,7 @@  module LaunchDarkly.Server.Network.Streaming (streamingThread) where -import Control.Applicative (many)+import Control.Applicative (many, (<|>)) import Control.Concurrent (threadDelay) import Control.Exception (throwIO) import Control.Monad (mzero, void)@@ -27,7 +27,7 @@ import System.Random (Random (randomR), newStdGen) import System.Timeout (timeout) -import LaunchDarkly.AesonCompat (KeyMap)+import LaunchDarkly.AesonCompat (KeyMap, emptyObject) import LaunchDarkly.Server.Config.ClientContext (ClientContext (..)) import LaunchDarkly.Server.Config.HttpConfiguration (HttpConfiguration (..), prepareRequest) import LaunchDarkly.Server.DataSource.Internal (DataSourceUpdates (..))@@ -39,7 +39,7 @@     { flags :: !(KeyMap Flag)     , segments :: !(KeyMap Segment)     }-    deriving (Generic, Show, FromJSON)+    deriving (Generic, Show)  data PathData d = PathData     { path :: !Text@@ -53,6 +53,12 @@     }     deriving (Generic, Show, FromJSON) +instance FromJSON PutBody where+    parseJSON = withObject "PutBody" $ \o -> do+        flags <- o .: "flags"+        segments <- o .:? "segments" .!= emptyObject+        pure $ PutBody {flags = flags, segments = segments}+ instance FromJSON a => FromJSON (PathData a) where     parseJSON = withObject "Put" $ \o -> do         pathData <- o .: "data"@@ -98,7 +104,7 @@  parseEvent :: Parser SSE parseEvent = do-    fields <- many (many comment >> parseField >>= pure)+    fields <- concat <$> many ((comment >> pure []) <|> fmap (: []) parseField)     endOfLineSSE     let event = foldr processField (SSE "" "" mzero mzero) fields     if T.null (name event) || T.null (buffer event) then parseEvent else pure event