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

fix(client-lex-runtime-v2): serialize eventstream payload properly #3655

Merged
merged 4 commits into from
Jun 13, 2022

Conversation

AllanZhengYP
Copy link
Contributor

Issue

Ref: P64550089
The Lex-runtime-v2 service cannot serialzie the event correctly because the events without eventHeader or eventPayload trait are not serialized, but returned as plain JavaScript object.

For example:

  1. The TextEvent is modeled as structure and serialized into a JavaScript Object(link).
  2. The JavaScript Object was directly passed to the event body(link) without serializing.
  3. This results in the event marshaller fails to the allocate correct bytelength, because it assumes the body to be binary data(link)

Description

This change makes sure the event payload are serialized to Uint8Array before encoded by event stream marshaller.

Testing

Manually tested

Additional context

Associated to smithy-lang/smithy-typescript#554


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AllanZhengYP AllanZhengYP requested a review from a team as a code owner June 2, 2022 02:19
@AllanZhengYP AllanZhengYP force-pushed the fix-lex-runtime-v2 branch 2 times, most recently from ae8a0c3 to 0c8d05c Compare June 2, 2022 02:23
@AllanZhengYP AllanZhengYP requested a review from kstich June 2, 2022 02:23
kuhe
kuhe previously approved these changes Jun 2, 2022
@AllanZhengYP AllanZhengYP merged commit 757f883 into aws:main Jun 13, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants