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

💥 Move setResponse from response to after.response middleware + fix missing unit test methods #901

Merged
merged 7 commits into from
Feb 22, 2021

Conversation

aswetlow
Copy link
Member

Proposed changes

Fixes

  • Fix request/responses methods in Conversation Actions that are used in unit tests.
  • Fix object copy in jovo-plugin-inbox from shallow to deep

Deprecation

Breaking change

Currently, platform responses are called in the response middleware. Other plugins - like any analytics integration - hook into the response middleware to post data after the setResponse of the host (Lambda, etc) has been called. This works because the request is not completed until all processes have run through. This won't work for Lambda with enabled callbackWaitsForEmptyEventLoop. Tasks in the response middleware pipe could be canceled before they are completed.

With this change setResponse is called in after.response. This would complete every task in response before the payload is returned.

Depending on depth and type of customization this could break plugins that hook into the response middleware.

Quick fix for these cases would be changing the middleware from response to after.response

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@aswetlow aswetlow merged commit 66de4a5 into master Feb 22, 2021
@aswetlow aswetlow deleted the fixnimprovement branch February 22, 2021 13:50
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.

1 participant