diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-10-07 22:17:40 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-10-07 22:17:40 +0200 |
commit | 52c874ab42cd266d1b26ce1c045fcaf8eb410b32 (patch) | |
tree | f990148ccde1b1d9defc7eb0a11637bf4d0cc06f /main/Test.hs | |
parent | 6d0e67bfdf84d1dff16232d8e31147f6c0d11cdf (diff) |
Handle unknown object type
Changelog: Handle unknown object type
Diffstat (limited to 'main/Test.hs')
-rw-r--r-- | main/Test.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/Test.hs b/main/Test.hs index 2155e09..741ffe8 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -309,7 +309,8 @@ cmdLoad = do st <- asks tiStorage [ tref ] <- asks tiParams Just ref <- liftIO $ readRef st $ encodeUtf8 tref - header : content <- return $ BL.lines $ lazyLoadBytes ref + let obj = load @Object ref + header : content <- return $ BL.lines $ serializeObject obj cmdOut $ "load-type " <> T.unpack (decodeUtf8 $ BL.toStrict header) forM_ content $ \line -> do cmdOut $ "load-line " <> T.unpack (decodeUtf8 $ BL.toStrict line) @@ -455,8 +456,10 @@ cmdStartServer = do , someService @SyncService Proxy , someService @ChatroomService Proxy , someServiceAttr $ (defaultServiceAttributes Proxy) - { testMessageReceived = \otype len sref -> - liftIO $ outLine out $ unwords ["test-message-received", otype, len, sref] + { testMessageReceived = \obj otype len sref -> do + liftIO $ do + void $ store (headStorage h) obj + outLine out $ unwords ["test-message-received", otype, len, sref] } ] |