Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Minor fixes for send-only clients #146

Merged
merged 3 commits into from
Jun 3, 2020
Merged

Conversation

kincaidoneil
Copy link
Member

  • Fix server hanging on shutdown if client never shared their ILP address
  • Share asset details in response to every ConnectionNewAddress frame
  • Fix bug in totalReceived accounting in StreamMaxMoney frames

The `StreamMaxMoney` frame with the totalReceived amount was being added before incoming money was added to each stream, so it was out of date
- reply with asset details not simply on the initial connection, but any packet with a `ConnectionNewAddress` frame
- more robust behavior when used with a send-only client
If the client never shared their ILP address and server.close() is called or the connection is closed from the server, the Promise would never resolve/send loop would never exit
Copy link
Contributor

@wilsonianb wilsonianb left a comment

Choose a reason for hiding this comment

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

👍
Highlighting this TODO since we're increasing the number of ConnectionMaxStreamIdFrames
https://github.com/interledgerjs/ilp-protocol-stream/blob/master/src/connection.ts#L951-L954

@sublimator
Copy link
Member

Will that fix this:
#123 ?

@kincaidoneil
Copy link
Member Author

Highlighting this TODO since we're increasing the number of ConnectionMaxStreamIdFrames

👍 I think if the client sent a ConnectionNewAddress frame and a StreamClose frame in the same packet, the server would reply with multiple ConnectionMaxStreamId frames -- though that's an unlikely case. I don't think that would cause any problems for the client though, it'd just be an optimization

Will that fix this: #123 ?

I don't think so? It still applies the amounts to each stream before calling addTotalReceived on the connection.

@sublimator
Copy link
Member

sublimator commented May 28, 2020 via email

@kincaidoneil
Copy link
Member Author

is that issue worth fixing? barely recall details

Per @sentientwaffle I think it'd be a breaking change: interledger/web-monetization-projects#115 (comment)

@kincaidoneil kincaidoneil merged commit 7046de8 into master Jun 3, 2020
@kincaidoneil kincaidoneil deleted the ko/send-only-fixes branch June 4, 2020 04:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants