Skip to content
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

Merged
merged 6 commits into from
Jul 13, 2023
Merged

Conversation

AriFordsham
Copy link
Contributor

@AriFordsham AriFordsham commented Jun 25, 2023

Before submitting your PR, check that you've:

  • Bumped the version number

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

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 when mkDispatchInstance passes subHelper to it (even though subHelper is unused ☹)

Copy link
Member

@snoyberg snoyberg left a 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.

@AriFordsham
Copy link
Contributor Author

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.

@jezen
Copy link
Member

jezen commented Jul 4, 2023

I think that sounds sensible 🙂

@AriFordsham
Copy link
Contributor Author

Added a test case. This does not compile on master, and passes on this PR.

@AriFordsham AriFordsham requested a review from snoyberg July 9, 2023 13:20
Copy link
Member

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

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

Thank you!

@snoyberg snoyberg merged commit b3416ec into yesodweb:master Jul 13, 2023
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mkYesodSubDispatch doesn't seem to work with nested subsites
3 participants