Skip to content

Conversation

@Muhammad-Altabba
Copy link

@Muhammad-Altabba Muhammad-Altabba commented Jul 7, 2021

If there is a response.id, expect a later message over WebSocket on that id.
This will be used to follow up on the interactions made by the user. Those interactions could be done through a mobile application, for example, that scans a QR code and take an action.

This is related to:
jolocom/web-service-base#1 and jolocom/hapi-jolocom#1

Copy link
Contributor

@mnzaki mnzaki left a comment

Choose a reason for hiding this comment

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

Hello @Muhammad-Altabba!

Thanks for the PR 😄
could you please elaborate on what the code in ws.onmessage is trying to achieve?
It seems to be doing things to the message after it has already been finalized

src/index.ts Outdated

if(msg.response && msg.response.id) {
if (this.rpcWS)
new Promise((resolve, reject) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?
it seems the value is discarded, and so the resolve on line 110 would basically have no effect (i.e. listening for Message resolution would be broken)

Copy link
Author

Choose a reason for hiding this comment

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

Many thanks @mnzaki,
And sorry, this was not all good. Now I fixed it and allowed for a continues receive of follow-up messages.

You can try the flow now with jolocom/interactions-demo#34

@Muhammad-Altabba Muhammad-Altabba changed the title Enable expecting continues responses at WebSocket [Draft] Enable expecting continues responses at WebSocket Jul 13, 2021
@Muhammad-Altabba Muhammad-Altabba changed the title [Draft] Enable expecting continues responses at WebSocket Enable expecting continues responses at WebSocket Jul 15, 2021
@Muhammad-Altabba Muhammad-Altabba force-pushed the feat/enable_waiting_for_next_response_over_websocket branch from 292d342 to 341f2d3 Compare August 11, 2021 20:00
@Muhammad-Altabba Muhammad-Altabba changed the title Enable expecting continues responses at WebSocket Enable expecting continuous responses at WebSocket Aug 11, 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