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(preview): detect and handle circular dependencies [SPA-2511] #962

Merged
merged 9 commits into from
Jan 28, 2025

Conversation

Chaoste
Copy link
Contributor

@Chaoste Chaoste commented Jan 27, 2025

Purpose

When there is a circular reference among used patterns, the fetchers and the renderer will fail with a "Maximum call stack size exceeded".

Approach

To handle this properly, we have to pass down the parent patterns. If a pattern appears that is already part of that set, we bail to avoid an infinite loop.

@Chaoste Chaoste requested review from a team as code owners January 27, 2025 13:40
Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nextjs-marketing-demo-bug-test 🔄 Building (Inspect) Visit Preview Jan 28, 2025 11:13am
3 Skipped Deployments
Name Status Preview Updated (UTC)
experience-builder-test-app ⬜️ Ignored (Inspect) Jan 28, 2025 11:13am
studio-nextjs-marketing-demo ⬜️ Ignored (Inspect) Jan 28, 2025 11:13am
studio-react-vite-template ⬜️ Ignored (Inspect) Jan 28, 2025 11:13am

@Chaoste Chaoste force-pushed the fix/SPA-2511-circular-dep-preview branch from 97f071d to ecef010 Compare January 27, 2025 16:20
@Chaoste Chaoste changed the base branch from development to fix/SPA-2511-reload January 28, 2025 07:10
Copy link
Contributor

@anwaar931 anwaar931 left a comment

Choose a reason for hiding this comment

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

Code looks good to me. 👍

@Chaoste Chaoste merged commit 05618fd into fix/SPA-2511-reload Jan 28, 2025
17 checks passed
@Chaoste Chaoste deleted the fix/SPA-2511-circular-dep-preview branch January 28, 2025 11:30
@Chaoste Chaoste restored the fix/SPA-2511-circular-dep-preview branch January 28, 2025 11:30
@Chaoste Chaoste deleted the fix/SPA-2511-circular-dep-preview branch January 28, 2025 12:48
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