-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix kåren misshap from today #133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good shit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I have a small request though: add what Kåren did the commit message and what effect it had on the operation of mat. It's very much optional, but I find it very enlightening to have that kind of documentation in the commit message.
@@ -120,7 +120,7 @@ parse lang = | |||
menuParser :: Value -> Parser Menu | |||
menuParser = withObject "Menu Object" $ \obj -> | |||
Menu | |||
<$> (obj .: "dishType" >>= (.: "name")) | |||
<$> (obj .: "dishType" >>= maybe (pure "Unknown menu") (.: "name")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that Kåren has changed the payload to sometimes not return an object with a "name"-field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This occured once, which was the morning of today, the 14th of august. Later, around ten, the payload was updated and looked as it has done before. This is a precaution if it would happen again.
"parses a blob of JSON without error, but it has an dish without dishType" | ||
( testFun | ||
(Right [ Menu | ||
(T.pack "Unknown menu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I see. Lovely surprise!
Kårres sent a payload which included a dish that didn't mention the dishType. This would allow such payloads to show up, but listed as "Unknown Menu", which allows the ones that properly parse to also be shown along this oddity.
Added a comment of what the fix does and why it was needed, kinda |
@The1Penguin Awesome! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cute 👍
No description provided.