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 variant roll changing when fetching assets #704

Merged
merged 3 commits into from
Dec 12, 2024
Merged

Conversation

APB9785
Copy link
Contributor

@APB9785 APB9785 commented Dec 12, 2024

Resolves #702

If a page loads other assets which pass through the Beacon.Plug, those assets were re-rolling the page variant, which caused the live render to sometimes have a different variant than the dead render (especially when response time is slower).

This PR only allows the initial page request to roll a variant, all other requests passing through that Plug will leave the variant session data untouched.

@APB9785 APB9785 requested a review from leandrocp December 12, 2024 18:00
@APB9785 APB9785 self-assigned this Dec 12, 2024
- return early if route is private, avoid unnecessary router server call
- replace lookup_page with lookup_path to avoid fetching the page module
@leandrocp leandrocp merged commit 61a0723 into main Dec 12, 2024
3 checks passed
@leandrocp leandrocp deleted the apb/fix-variant-roll branch December 12, 2024 19:03
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.

Dead render can differ from LiveView render with variants
2 participants