Skip to content

fix: infinite loop in findUp utility when a result is not found #12457

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
May 23, 2025

Conversation

rjgtav
Copy link
Contributor

@rjgtav rjgtav commented May 20, 2025

What?

Fixes an infinite loop that may occur when invoking the findUp() utility to search for a file by name and no result is found.

Why?

If triggered, the infinite loop will hang the entire application. For example, this occurs when trying to boot Payload from a Cloudflare Worker, as reported in #12327

How?

By checking whether it has reached the root directory before analysing the parent folder

@vicb
Copy link

vicb commented May 20, 2025

/cc @conico974

@paulpopus paulpopus merged commit 842d184 into payloadcms:main May 23, 2025
81 checks passed
Copy link
Contributor

🚀 This is included in version v3.40.0

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.

3 participants