In bark we are switching from pay to xpay.
I notice many of our tests did become flaky after the change and started debugging.
The error message Destination said it doesn't know invoice: incorrect_or_unknown_payment_details started to appear out of nowhere
What is the root-cause
We are on regtest so blocks are generated at a higher speed and lightning nodes aren't always in sync.
When the payer is lagging behind it will create HTLC's that are too short lived. The payee will refuse the payment.
What could be a fix?
I think we give up a bit early. There is retry logic in xpay but for some reason no retries are attempted.
A more helpful error message would be nice as well
Work-arounds
I am adapting our test-suite to always wait for block-sync on all nodes before making a lightning payment.