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

Allow to bypass stringification of publish payload #171

Closed
edzis opened this issue Feb 2, 2021 · 3 comments
Closed

Allow to bypass stringification of publish payload #171

edzis opened this issue Feb 2, 2021 · 3 comments
Assignees

Comments

@edzis
Copy link
Contributor

edzis commented Feb 2, 2021

I am migrating our browser client from aws-iot-device-sdk to aws-crt/dist.browser/browser/mqtt and need to send a Uint8Array payload because the other end expects that. Unfortunately

let payload_data = normalize_payload(payload);
converts the payload to a string format.

I am not aware any reasoning in favor of stringification and am not challenging that. However I would like to have a way to bypass that.

A custom implementation could be passed in MqttConnectionConfig or overwritten as a static function of MqttClientConnection or MqttClient.

@edzis
Copy link
Contributor Author

edzis commented Feb 2, 2021

And maybe you could point me to some argumentation for the use of this normalization? Maybe we are just bending the best practices with our usage.

@graebm graebm self-assigned this Feb 18, 2021
@graebm graebm added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Feb 18, 2021
@graebm graebm added pr/needs-review This PR needs a review from a Member. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 19, 2021
@graebm graebm added pending-release This issue will be fixed by an approved PR that hasn't been released yet. and removed pr/needs-review This PR needs a review from a Member. pending-release This issue will be fixed by an approved PR that hasn't been released yet. labels Feb 20, 2021
@graebm
Copy link
Contributor

graebm commented Feb 20, 2021

Fixed in latest releases of aws-crt and aws-iot-device-sdk-v2

@graebm graebm closed this as completed Feb 20, 2021
@graebm
Copy link
Contributor

graebm commented Feb 20, 2021

To bypass stringification pass an ArrayBuffer, or some ArrayBufferView such as Uint8Array or DataView

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

No branches or pull requests

2 participants