Skip to content

Fix hook order inside while loop #1615

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

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Fix hook order inside while loop #1615

merged 1 commit into from
Jun 17, 2025

Conversation

jonatanklosko
Copy link
Member

We use tokens to order hooks, but currently when we enter while loop, we don't use the latest token, we always use the starting one. In certain cases this leads to outfeeds in unexpected order and results in an error.

Comment on lines +315 to 318
{initial, cache} = recur_composite(initial_arg, state, cache)

initial =
if token = get_token(cache) do
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to recur on initial_arg first and use the cached token. Currently we get the token first, so it doesn't account for all the prior computation.

@jonatanklosko jonatanklosko merged commit d9364bb into main Jun 17, 2025
5 of 8 checks passed
@jonatanklosko jonatanklosko deleted the jk-while-token branch June 17, 2025 13:56
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