Skip to content

Conversation

@peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Jun 21, 2021

This PR contains:

  • A fix to the Transform that does hashing on upload, to avoid incomplete data transfers
  • Fix the sender for blobs arriving from other members
  • Fixes to make Typescript happy (implicit any errors preventing my build running)
  • Additional logging to diagnose cases where events are not flowing, including an event ID
  • Simplified logger that works with the docker compose output in firefly-cli

With e2e testing, I was finding:

  • The binary data stored in the blob store was incomplete
  • The hash was incorrect (this was detected on the FireFly core side)

After much debugging to see if core was somehow not propagating the data stream through correctly, I tried running the DX locally, and I found I was getting the following error:

{"name":"app.ts","hostname":"peters-mbp-3.lan","pid":65130,"level":30,"msg":"New WebSocket delegate assigned","time":"2021-06-20T03:00:22.784Z","v":0}
(node:65130) UnhandledPromiseRejectionWarning: Error [ERR_CRYPTO_HASH_FINALIZED]: Digest already called
    at Hash.update (internal/crypto/hash.js:79:11)
    at Transform.<anonymous> (/Users/peterbroadhurst/dev/photic/firefly-dataexchange-https/src/handlers/blobs.ts:50:12)
    at Generator.next (<anonymous>)
    at /Users/peterbroadhurst/dev/photic/firefly-dataexchange-https/src/handlers/blobs.ts:42:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/peterbroadhurst/dev/photic/firefly-dataexchange-https/src/handlers/blobs.ts:38:12)
    at Transform.transform [as _transform] (/Users/peterbroadhurst/dev/photic/firefly-dataexchange-https/src/handlers/blobs.ts:79:20)
    at Transform._read (_stream_transform.js:205:10)
    at Transform.Readable.read (_stream_readable.js:481:10)
    at flow (_stream_readable.js:992:34)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:65130) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:65130) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst
Copy link
Contributor Author

@gabriel-indik - sorry for the previously messy fix for the Typescript issues.
Found the custom.d.ts file as the correct place to do the fix, and just had to type the inputs explicitly to ensure we imported the type definition.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst peterbroadhurst mentioned this pull request Jun 22, 2021
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