Repository navigation
Fix: Integer route keys in tag bindings crashed requests (1.5.4) - #31
Merged
Merged
Conversation
A tag binding to a model with an integer route key, like user:{user}, passed
an int to str_replace() under strict_types, so every request to the route
failed with a TypeError.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGNGyJLoFTM5C474gZPW5q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a crash on the v1 line: a cache tag binding to a model with an integer route key (e.g.
response_cache:users,user:{user}with a standard Eloquent model) passed aninttostr_replace()understrict_types. Every request to such a route failed with:The fix casts the resolved value to a string. The bug was found while testing v2 (#30) against a fresh Laravel app, and is fixed there too.
This targets the new
1.xmaintenance branch, created from the1.5.3tag, and is meant for release as 1.5.4.Test plan
resolves bound models with integer keys in tagsreproduces theTypeError, and passes with the fix.vendor/bin/pest: 15 passing.1.5.3itself. Nothing new was introduced, and they are left alone to keep the patch minimal.1.xhas no CI workflow; it was added onmasterafter 1.5.3.🤖 Generated with Claude Code
https://claude.ai/code/session_01GGNGyJLoFTM5C474gZPW5q