Skip to content

Commit

Permalink
Fix bug with multiple answer choices
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Nov 2, 2020
1 parent 8edbf2d commit 3ca5432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/HW/S3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ makeObjectKey = do
toRqBody :: LazyByteString.ByteString -> Aws.RqBody
toRqBody = Aws.toBody
. Aeson.encode
. Map.fromList
. Map.fromListWith (<>)
. Maybe.mapMaybe (\ (key, maybeValue) -> do
value <- maybeValue
Monad.guard . not $ Text.null value
pure (key, value))
pure (key, [value]))
. Http.parseQueryText
. LazyByteString.toStrict

2 comments on commit 3ca5432

@tfausak
Copy link
Collaborator Author

@tfausak tfausak commented on 3ca5432 Nov 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad. For anyone that selected multiple choices to answer a single question, I only recorded one of those choices. This includes "other" choices.

Unfortunately there is no way to recover the data. The call to Map.fromList simply picks one and discards the others. The request bodies are not logged anywhere.

@tfausak
Copy link
Collaborator Author

@tfausak tfausak commented on 3ca5432 Nov 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #61.

Please sign in to comment.