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

app.before_request & app.after_request do not run in sub app #478

Open
iaudouard opened this issue Jan 10, 2024 · 4 comments
Open

app.before_request & app.after_request do not run in sub app #478

iaudouard opened this issue Jan 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@iaudouard
Copy link

Currently, the before_request & after_request decorators do not run when attached to a sub app, would it be possible to support this?

@anovis
Copy link
Collaborator

anovis commented Jan 10, 2024

@iaudouard is the decorator added to the subapp and it is not triggering on requests, or is the decorator on the main app and requests to the subapp are not triggering it?

@anovis anovis added the bug Something isn't working label Jan 10, 2024
@iaudouard
Copy link
Author

iaudouard commented Jan 10, 2024

@anovis The decorator is added to the subapp and isn't triggering on requests. I'm guessing this is the expected behavior?

@anovis
Copy link
Collaborator

anovis commented Jan 10, 2024

Hmm I haven't run into that use case before. I will look into it. On the one hand I don't want that decorator to trigger on all other subapps, but not sure if there is an easy way to trigger just on that specific subapp.

In the meantime you can try just adding it to the main app, while I look into the subapp specific case.

@anovis
Copy link
Collaborator

anovis commented Jan 10, 2024

looks like we dont combine alerts or infra or middleware for subapps. https://github.com/goblet/goblet/blob/main/goblet/resource_manager.py#L193

so this is certainly a bug.

i will also make sure that middleware is added to a subapp it is only applied for that sub-app.

it should be possible since we track all subapps via self.app_list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants