Skip to content

Fix infinite recursion on circular selectable dependencies#469

Open
alex-tan wants to merge 1 commit into
mmkal:mainfrom
alex-tan:atan/migra-circular-dependency-fix
Open

Fix infinite recursion on circular selectable dependencies#469
alex-tan wants to merge 1 commit into
mmkal:mainfrom
alex-tan:atan/migra-circular-dependency-fix

Conversation

@alex-tan

@alex-tan alex-tan commented Jul 1, 2026

Copy link
Copy Markdown

get_related_for_item recursed forever when selectables had circular dependent_on/dependents chains (e.g. mutually-referencing views), causing "RangeError: Maximum call stack size exceeded" during load_deps_all. Add a visited set to guard against revisiting the same signature, and filter the root signature out of the result everywhere it reappears (not just the first occurrence via slice(1), which missed later reappearances introduced by the cycle).

Includes a regression test that fails with the old recursion (confirmed via RangeError) and passes with this fix.

get_related_for_item recursed forever when selectables had circular
dependent_on/dependents chains (e.g. mutually-referencing views),
causing "RangeError: Maximum call stack size exceeded" during
load_deps_all. Add a visited set to guard against revisiting the same
signature, and filter the root signature out of the result everywhere
it reappears (not just the first occurrence via slice(1), which missed
later reappearances introduced by the cycle).

Includes a regression test that fails with the old recursion (confirmed
via RangeError) and passes with this fix.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the mmkal Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant