-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement metadata handling #4
Conversation
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.
Just a couple of non-blocking questions and clean-up recommendations. Overall, LTGM.
// { | ||
// type: 'success', | ||
// payload: 'I am a werewolf', | ||
// metadata: { |
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.
Are we expecting the response_id
to be included in the metadata as a standard now? If so, can we add an example of the response_id
being included 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.
No, the data-translator
is a general-use translator, the response_id
is implementation-specific between Chaperone and Envoy.
if ( arguments.length === 2 ) { | ||
if ( value === undefined ) { | ||
const previous_value = this._metadata[key]; | ||
delete this._metadata[key]; | ||
return previous_value; | ||
} |
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.
Can you put this into context for me? When might the metadata return without a value, and why how do we know it's response_id
will be/should be the exact same?
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 fully understand the question. The metadata value is always returned, but the value may have been set to undefined
(via delete
)
Co-authored-by: Lisa Jetton <lisa.jetton@holo.host>
Co-authored-by: Lisa Jetton <lisa.jetton@holo.host>
Changes
metadata( key, value? )
method to get/set package metadata