hyperledger-archives / aries-framework-go

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.
https://wiki.hyperledger.org/display/ARIES/aries-framework-go
Apache License 2.0
240 stars 161 forks source link

[aries-js-worker] Safari raise "Could not decode a text frame as UTF-8." in WebSocket Communication #1966

Closed cyrilhl closed 4 years ago

cyrilhl commented 4 years ago

I am trying to test the aries js worker(aries-framework-go/cmd/aries-js-worker/index.html) and had some success in Chrome, including make connection with a router agent, make connection with other edge agent through router agent and send message to other edge agent.

And I move on to safari on OSX, it run "didexchange" "receiveInvitation" fine with a router agent invitation, and I try to "accecptRequest" in router agent. WebSocket in safari it raise WebSocket connection failed: Could not decode a text frame as UTF-8.

Expected result Expect edge agent receive respond from router agent and complete connection

Actual result [Log] incoming msg : – "cc053257-db0f-436f-a95c-e5752286b7c8" – "didexchange_states" – {Message: Object, Properties: {connectionID: "c4993e26-7b72-4883-bf59-ef3c3bdd058c", invitationID: "a4ca4538-9bd7-4a44-b03f-c489d185e09e"}, ProtocolName: "didexchange", …} (index.html, line 74) {Message: Object, Properties: {connectionID: "c4993e26-7b72-4883-bf59-ef3c3bdd058c", invitationID: "a4ca4538-9bd7-4a44-b03f-c489d185e09e"}, ProtocolName: "didexchange", StateID: "requested", Type: "post_state"}ObjectMessage: {@id: "a4ca4538-9bd7-4a44-b03f-c489d185e09e", @type: "https://didcomm.org/didexchange/1.0/invitation", label: "carl-router-agent", recipientKeys: ["6Lqa4j2huX9L6fNWWjTjgNwZLkEU3sK2WQTQR9TErNrE"], serviceEndpoint: "wss://router.unifysoft.com/ws"}ObjectProperties: {connectionID: "c4993e26-7b72-4883-bf59-ef3c3bdd058c", invitationID: "a4ca4538-9bd7-4a44-b03f-c489d185e09e"}ObjectProtocolName: "didexchange"StateID: "requested"Type: "post_state"Object Prototype [Error] WebSocket connection to 'wss://myserver' failed: Could not decode a text frame as UTF-8. [Log] [aries-framework/ws] 2020/06/30 08:09:27 UTC - ws.(connPool).listener -> ERROR Error reading request message: failed to read: WebSocket closed: unclean connection close: status = StatusAbnormalClosure and reason = "" (wasm_exec.js, line 47) [Log] [aries-framework/ws] 2020/06/30 08:09:27 UTC - ws.(connPool).close -> ERROR connection close error (wasm_exec.js, line 47)

test case

  1. Run "make run-openapi-demo" on local machine

  2. Create invitation with carl router agent by "http://localhost:10093/connections/create-invitation" on swagger page

  3. Host "aries-framework-go/cmd/aries-js-worker/index.html" on local web server

  4. Open aries js worker web page

  5. Start agent and start notifier

  6. Run "didexchange" "receiveInvitation" with previous generated invitation

  7. Run "didexchange" "acceptInvitation" with connection id return in step 6

  8. Back to swagger page, accecpt the new connection

  9. WebSocket error raise in js worker

soluchok commented 4 years ago

@cyrilhl Thank you for letting us know.

llorllale commented 4 years ago

@cyrilhl can you please test with the latest version and let us know?

cyrilhl commented 4 years ago

@cyrilhl can you please test with the latest version and let us know?

Thank you for your prompt action, and I tested on safari on both OSX and iOS, both of them work properly now.