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: boot beacon even without defined beacon_site routes in host app … #699

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

leandrocp
Copy link
Contributor

@leandrocp leandrocp commented Dec 10, 2024

Starting a site in the sup tree is not enough, each site must have a corresponding route in the host app's router. But in some cases the route might be missing, which would lead to boot crashes.

Now we're guarding against such scenario and allowing Beacon to boot, but we emit a warning with a link to a troubleshot guide.

@leandrocp leandrocp marked this pull request as ready for review December 11, 2024 00:00
@leandrocp leandrocp requested a review from APB9785 December 11, 2024 00:00
@APB9785
Copy link
Contributor

APB9785 commented Dec 11, 2024

this covers the case of zero sites in the router, but what about cases where 2 sites are started in config, but only 1 is defined in the router? would that still cause the boot to fail?

Copy link
Contributor

@APB9785 APB9785 left a comment

Choose a reason for hiding this comment

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

ah, I see, this affects the Enum.reduce we do over the list of sites in Beacon.init/1, works for me 🚀

@leandrocp
Copy link
Contributor Author

ah, I see, this affects the Enum.reduce we do over the list of sites in Beacon.init/1, works for me 🚀

yep although needs to verify some other edge case, so merging this one now and I will write a few more tests tomorrow

@leandrocp leandrocp merged commit 9340edb into main Dec 11, 2024
3 checks passed
@leandrocp leandrocp deleted the lp-no-routes branch December 11, 2024 02:45
leandrocp added a commit that referenced this pull request Dec 11, 2024
#699)

* fix: boot beacon even without defined beacon_site routes in host app router

* clean up

* docs
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.

2 participants