This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also include request and app level locals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifically, should we just spread
baseContext
into here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing in
request
/response
sounds good!Could pass this is in explicitly - spreading in
baseContext
sounds good too, at the risk of potentially increasing the public api surface area.I'll update the PR to do this.
(Side note - unclear what
batchMeta
is used for? Can this be removed?)╔═ markl@dev21-uswest1cdevc: ~/oss/hypernova git:(add_response_object_to_context) ╚═ ♪ git --no-pager grep batchMeta src/utils/BatchManager.js:75: batchMeta: {},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change line 147 to be
It would be a breaking change but then the context passed in would have access to
baseContext
as well.The downside is that the whole response object would be made available which means that consumers may be able to hijack the response.