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

AfterRoutingMiddleware can not be executed. #658

Closed
achinastone opened this issue May 18, 2023 · 1 comment
Closed

AfterRoutingMiddleware can not be executed. #658

achinastone opened this issue May 18, 2023 · 1 comment
Assignees
Labels
accepted Issue has been accepted and inserted in a future milestone bug
Milestone

Comments

@achinastone
Copy link

achinastone commented May 18, 2023

TMVCActiveRecordMiddleware will add database connection in Middleware.OnBeforeRouting .
and remove connection in Middleware.OnAfterRouting

But in function TMVCEngine.ExecuteAction
ExecuteBeforeControllerActionMiddleware Maybe handle the request and then call the "Exit(True)", this will ignore the Middleware.OnAfterRouting.
So, when the next request arrived. The add database connection(in Middleware.OnBeforeRouting) behavior will execute again and lead exception with duplicate message .

@danieleteti danieleteti self-assigned this May 18, 2023
@danieleteti danieleteti added the accepted Issue has been accepted and inserted in a future milestone label May 18, 2023
@danieleteti danieleteti added this to the 3.4.0-neon milestone May 18, 2023
danieleteti added a commit that referenced this issue May 26, 2023
@danieleteti danieleteti reopened this May 26, 2023
@danieleteti
Copy link
Owner

Solved with #680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue has been accepted and inserted in a future milestone bug
Projects
None yet
Development

No branches or pull requests

2 participants