Skip to content

Fix: preserve custom onFail callback in UniversalRoutes::bootstrap()#1471

Closed
JeremyRed wants to merge 1 commit into
archtechx:3.xfrom
JeremyRed:3.x
Closed

Fix: preserve custom onFail callback in UniversalRoutes::bootstrap()#1471
JeremyRed wants to merge 1 commit into
archtechx:3.xfrom
JeremyRed:3.x

Conversation

@JeremyRed

Copy link
Copy Markdown

Fixes #1470

This is a small, low-risk fix for the issue linked above, happy to adjust the approach if you'd prefer to solve it differently, but since the change is minimal and the impact felt high-value, I thought it was worth putting together as a starting point.

What this changes

UniversalRoutes::bootstrap() currently overwrites $onFail on both identification middlewares unconditionally, discarding any custom callback the application had set. This PR captures the existing callback before overwriting it, and falls back to it (instead of throwing) when the UniversalRoutes bypass check doesn't apply.

We've tested this against our own setup and confirmed it resolves the behaviour described in #1470. Open to feedback if you'd rather handle this differently (e.g. scoping it to v3 only given the v4/main split).

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 79534c48-4f57-4055-99ec-d36ad3294713

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stancl

stancl commented Jul 21, 2026

Copy link
Copy Markdown
Member

Thanks for the PR. Unfortunately we don't intend on making these sorts of changes to v3 when v4 (with the issue addressed and the whole feature later implemented differently) will be released shortly, see #1470 (comment)

@stancl stancl closed this Jul 21, 2026
@JeremyRed

Copy link
Copy Markdown
Author

Thanks for taking a look, and for the quick response. I know v4 has been in development for a while now, figured a small, low-risk patch might still be worth having but completely understand not wanting to carry changes forward that'll be superseded soon anyway.

Thanks again for maintaining the package, we'll keep an eye out for v4!

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