interledgerjs / ilp-plugin-xrp-asym-client

Client to Asymmetric XRP Paychan
4 stars 3 forks source link

Fix: catch errors in auto claim interval #32

Closed sharafian closed 6 years ago

sharafian commented 6 years ago

Turns out that when the callback in setInterval throws an error, it cancels the interval. This could put asym-clients into a bad state where they're no longer submitting claims automatically. Some T04s are caused as a result of this issue, when the asym server can't see the best claim it signed by looking at the ledger.

Given that the callback is an async function, I haven't yet identified where the error could be thrown.

dino-rodriguez commented 6 years ago

It seems the error might come from within the claimFunds function, as really the only function call with async calls that accept suspect parameters. Within that, the preparePaymentChannelClaim api call might be using an outdated payment channel? Or perhaps the fee for the claim (returned from the previous api call) might be too high (account doesn't have enough funds). In which case the submit api call could be failing, which would log more verbose errors.

codecov-io commented 6 years ago

Codecov Report

Merging #32 into master will decrease coverage by 0.39%. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #32     +/-   ##
========================================
- Coverage   48.99%   48.6%   -0.4%     
========================================
  Files           1       1             
  Lines         249     251      +2     
========================================
  Hits          122     122             
- Misses        127     129      +2
Impacted Files Coverage Δ
index.js 48.6% <0%> (-0.4%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 57687c6...0aff5e8. Read the comment docs.