Skip to content

Fix#2

Merged
MakMuftic merged 4 commits into
NodeFactoryIo:mmuftic/ipfs-packagefrom
polywrap:ipfs-testing
Mar 8, 2021
Merged

Fix#2
MakMuftic merged 4 commits into
NodeFactoryIo:mmuftic/ipfs-packagefrom
polywrap:ipfs-testing

Conversation

@dOrgJelli
Copy link
Copy Markdown
Collaborator

@dOrgJelli dOrgJelli commented Mar 8, 2021

The main fix is in packages/js/client/src/wasm/thread.ts (see PR comment below)

Some additional things I did:

  • Bumped node version to v14.15.1 which is the most recent active LTS version (https://nodejs.org/en/about/releases/)
  • Added some helper scripts to the IPFS Web3API package. Now you can simply run yarn test:env:up, yarn deploy, yarn test to see it all running and working.
  • Renamed "catFile" to "catToString" for easy testing to make sure the result is correct. It looks like the data is being returned twice, which appears to be an issue coming from the HTTP plugin if I'm not mistaken @mpetrun5 @MakMuftic. Simply run the above commands to see the output.
  • Added a "test.txt" file with lorem ipsum text to make sure long text is working fine.
  • Made the module a query module instead of a mutation module, since cat is a read only operation.
  • Used the HTTP Plugin's get query method instead of post mutation.
  • Updated the HTTP Plugin to use the ResponseType enum, now that it's supported :D (thank you @mpetrun5 👏)
  • Fixed 2 bugs in the schema bind & compose packages.

Comment on lines +117 to +119
const oldData = data;
data = new Uint8Array(newLength);
data.set(oldData);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is what was broken when sending subinvoke result data back to the thread.


let config: AxiosRequestConfig = {
responseType: request.responseType == "BINARY" ? "arraybuffer" : "text",
responseType: request.responseType == ResponseType.BINARY ? "arraybuffer" : "text",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This won't work as enum from schema will be converted to a string.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is not the case, enums are represented as integers when they're coming from Web3APIs. They're only (optionally) represented as strings when the client is sending an enum as an argument to a Web3API method.

@MakMuftic MakMuftic merged commit 7c56b1f into NodeFactoryIo:mmuftic/ipfs-package Mar 8, 2021
@dOrgJelli dOrgJelli deleted the ipfs-testing branch January 7, 2022 00:07
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

Successfully merging this pull request may close these issues.

2 participants