node icon indicating copy to clipboard operation
node copied to clipboard

Ensure payment exchange on session end

Open vkuznecovas opened this issue 4 years ago • 2 comments

This is a low priority as it's more of a nice-to-have than a real prerequisite.

Due to the async nature of the payment system, a situation might occur where a consumers reported spending is larger than the actual amount that reaches hermes.

This happens in the following flow:

  1. Session is established.
  2. Payments occur normally for some time.
  3. Consumer received yet another invoice.
  4. Consumer starts calculating the amount to promise.
  5. Session is killed as operation 4) is happening.
  6. The promise is incremented but never issued as the session is aborted. This can happen due to promise not being sent, or provider not listening for further promises on the given topic.
  7. Hermes is not aware of the last promise, therefore the consumer and hermes reportings are different.

Under normal circumstances, such occurences should be VERY, VERY rare and the amount of myst involved is rather small. They should have no impact on the payment system as a whole.

We can, however, improve this by making sure that "last promise" is issued and reaches the provider before session end.

This was originally discovered while investigating #2984

vkuznecovas avatar Jan 07 '21 10:01 vkuznecovas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '22 20:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 08 '22 20:08 stale[bot]

No one will ever do this.

tomasmik avatar Aug 17 '22 11:08 tomasmik