Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

fix: convert input to buffers before passing to aws-sdk #30

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 21, 2020

The aws-sdk uses the node http client internally which doesn't support Uint8Arrays as data, only strings or buffers so convert non-Buffers to Buffers before passing them on.

Converts Buffers to Uint8Arrays via no-copy method to remain consistent with other interface-datastore implementations.

Updates deps to use latest interface-datastore and aegir.

BREAKING CHANGE:

  • Returns Uint8Arrays only where before it was node Buffers
  • Sharding is turned on by default for all datastores (e.g. blocks, datastore, pins, etc) - overrides the ipfs-repo default which is only to turn on sharding for blocks

The aws-sdk uses the node http client internally which doesn't support
Uint8Arrays as data, only [strings or buffers](https://nodejs.org/api/http.html#http_request_end_data_encoding_callback)
so convert non-Buffers to Buffers before passing them on.

Converts Buffers to Uint8Arrays via no-copy method to remain consistent
with other interface-datastore implementations.

Updates deps to use latest interface-datastore and aegir.

BREAKING CHANGE:

- Returns Uint8Arrays only where before it was node Buffers
@achingbrain
Copy link
Member Author

The output conversion may be an overreach, can remove if so desired.

@jacobheun jacobheun force-pushed the fix/covert-to-buffers-before-passing-to-aws branch from 9d64304 to 0d1eab8 Compare September 22, 2020 11:26
Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @achingbrain the example was failing so I updated it to verify everything was working.

@jacobheun jacobheun merged commit b844c63 into master Sep 22, 2020
@jacobheun jacobheun deleted the fix/covert-to-buffers-before-passing-to-aws branch September 22, 2020 11:48
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.

2 participants