Skip to content

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

Merged
paulpopus merged 1 commit into
payloadcms:mainfrom
rjgtav:patch-1
May 23, 2025
Merged

paulpopus merged 1 commit into
payloadcms:mainfrom
rjgtav:patch-1

Conversation

@rjgtav

@rjgtav rjgtav commented May 20, 2025

Copy link
Copy Markdown
Contributor

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

vicb commented May 20, 2025

Copy link
Copy Markdown

/cc @conico974

@paulpopus
paulpopus merged commit 842d184 into payloadcms:main May 23, 2025
@github-actions

Copy link
Copy Markdown
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