From d59cd166ce74beec8f22c348bb4cd576907b080a Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Tue, 5 Jun 2012 01:52:47 -0700 Subject: [PATCH] In the future send better initialize message when the file store is inactive --- src/WebsocketApp.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/WebsocketApp.hs b/src/WebsocketApp.hs index 1be295a..96fdfb4 100644 --- a/src/WebsocketApp.hs +++ b/src/WebsocketApp.hs @@ -33,9 +33,8 @@ websocketApp clients fileStore serverMessages clientMessages req = do liftIO $ putStrLn $ "Client connected (TODO: lookup client)..." -- Send the list of files currently in the file store to the client application - -- TODO: There's a synchronization issue here: if a file is loaded it will be added to the file store - -- before the LOAD message is sent to the client. - -- The file store should be updated by the message processing queue, not by the FileObserver! + -- TODO: Read an "active" flag from the file store. + -- If the file store is not active, then send ReloadFiles LostRootDirectory or similar instead files <- liftIO $ STM.FileStore.contents fileStore sendMessage $ ReloadFiles Connected files