Flask; when sentry catches an error @app.after_request doesn't run

Going through an upgrade project from Python 2 → 3, and just realized after_request doesn’t execute if Sentry caught anything. My after_request sets CORS headers based on a dynamic subdomain. I see a similar error 4 years ago that lacked resolution. Cordova iOS WKWebview + Sentry doesn't send requests (CORS) - #3 by stripathix

Any suggestions to keep after_request running?

after_request does run in principle. In devserver this may not be the case, but it’s unrelated to Sentry. Could you prepare a minimal reproducible example if you’re encountering issues here?

I’ve been unable to create a simple case. The complicated case happens reliably. Seems like there’s something else subtle going on in there so it must not be Sentry. Sorry!