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

[5.x] Prevent infinite loops with Laravel Telescope #11390

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Jan 24, 2025

This pull request fixes an issue with Laravel Telescope installed, where an infinite loop would occur if you had entries which link to each other.

Right now, when Telescope encounters an Entry object (whether that be in an event, or in an authorization gate), it'll attempt to serialize it using ->jsonSerialize() which'll return an evaluated array of the augmented entry.

However, if you have an entry which relates back to itself, this evaluated array can cause an infinite loop.

This PR addresses that by returning a shallow augmented array instead, which prevents relationships from being evaluated in the same way, therefore preventing the infinite loop issue.

This fix relies on the formatForTelescope method, added in laravel/telescope#1562. You'll need to be using Telescope v5.4.0 or above for this fix to work.

Fixes #10782.

@duncanmcclean duncanmcclean marked this pull request as ready for review January 24, 2025 17:49
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.

Telescope infinite loop issue
2 participants