Skip to content

Commit

Permalink
Improved strictness
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Feb 1, 2022
1 parent 72c366e commit 3439302
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IHP/DataSync/Controller.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ instance (
Just record -> do
-- Add the new record to 'watchedRecordIdsRef'
-- Otherwise the updates and deletes will not be dispatched to the client
modifyIORef watchedRecordIdsRef (Set.insert id)
modifyIORef' watchedRecordIdsRef (Set.insert id)
sendJSON DidInsert { subscriptionId, record }
Nothing -> pure ()
Expand All @@ -113,7 +113,7 @@ instance (
channelSubscription <- pgListener
|> PGListener.subscribeJSON (ChangeNotifications.channelName tableNameRLS) callback
modifyIORef ?state (\state -> state |> modify #subscriptions (HashMap.insert subscriptionId Subscription { id = subscriptionId, channelSubscription }))
modifyIORef' ?state (\state -> state |> modify #subscriptions (HashMap.insert subscriptionId Subscription { id = subscriptionId, channelSubscription }))
sendJSON DidCreateDataSubscription { subscriptionId, requestId, result }
Expand All @@ -126,7 +126,7 @@ instance (
Just subscription -> pgListener |> PGListener.unsubscribe (get #channelSubscription subscription)
Nothing -> pure ()
modifyIORef ?state (\state -> state |> modify #subscriptions (HashMap.delete subscriptionId))
modifyIORef' ?state (\state -> state |> modify #subscriptions (HashMap.delete subscriptionId))
sendJSON DidDeleteDataSubscription { subscriptionId, requestId }
Expand Down

0 comments on commit 3439302

Please sign in to comment.