Enable expecting continuous responses at WebSocket#1
Open
Muhammad-Altabba wants to merge 3 commits intojolocom:masterfrom
Open
Conversation
mnzaki
reviewed
Jul 8, 2021
Contributor
mnzaki
left a comment
There was a problem hiding this comment.
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
|
|
||
| if(msg.response && msg.response.id) { | ||
| if (this.rpcWS) | ||
| new Promise((resolve, reject) => { |
Contributor
There was a problem hiding this comment.
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)
Author
There was a problem hiding this comment.
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
292d342 to
341f2d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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