-
Notifications
You must be signed in to change notification settings - Fork 367
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 subsite-to-subsite dispatch #1805
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.
I can't really claim a lot of familiarity with this code anymore, it's been a while, but the overall approach seems valid. I'd recommend including a test case to demonstrate that this is working. And if all the existing test cases pass, I think that's a good sign that it's working as expected.
A fails-before, passes-after test is hard to write, because the failure is compile-time. I guess I could just include a simple test which show subsite-to-subsite dispatch working. |
I think that sounds sensible 🙂 |
Added a test case. This does not compile on master, and passes on this PR. |
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.
Thank you!
Before submitting your PR, check that you've:
After submitting your PR:
Fixes #1803 .
It is now behaving correctly on https://github.com/jezen/subsite-with-static (see https://github.com/AriFordsham/subsite-with-static/tree/ari/yesod-change).
It's a bit messier than I wuld like, as well as being a hack overall - see #1803 (comment). The type signature to
subTopDispatch
makes sure this builds whenmkDispatchInstance
passessubHelper
to it (even thoughsubHelper
is unused ☹)