Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix Response.update_from to also copy close handlers #8946

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

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

thrau
Copy link
Member

@thrau thrau commented Aug 21, 2023

Motivation

This is in some sense a follow up to #8926. I wanted to use the close callbacks of werkzeug to properly implement the restarting of localstack after extensions have been installed (see ext PR). I noticed this wasn't working because we actually often create new Response objects and then use Response.update_from in the handler chain, which didn't copy the internal on close callbacks correctly

Changes

  • Update our Response.update_from method to copy the internal _on_close handlers correctly
  • Add an integration test to make sure the close callbacks work correctly

@thrau thrau requested a review from dfangl August 21, 2023 09:16
@thrau thrau added the semver: patch Non-breaking changes which can be included in patch releases label Aug 21, 2023
@thrau thrau force-pushed the fix-close-callbacks branch from bb8c069 to 8d64e48 Compare August 22, 2023 11:33
@coveralls
Copy link

coveralls commented Aug 22, 2023

Coverage Status

coverage: 80.125% (+0.006%) from 80.119% when pulling aa01aa0 on fix-close-callbacks into 6c91207 on master.

Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thrau thrau force-pushed the fix-close-callbacks branch from 8d64e48 to aa01aa0 Compare September 13, 2023 19:11
@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 11m 29s ⏱️
2 200 tests 1 706 ✔️ 494 💤 0
2 201 runs  1 706 ✔️ 495 💤 0

Results for commit aa01aa0.

@thrau thrau merged commit ed4f0fb into master Sep 13, 2023
@thrau thrau deleted the fix-close-callbacks branch September 13, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants