Is there some reason for this line to be an OR instead of AND?

27 views
Skip to first unread message

Pereira

unread,
Jan 7, 2022, 9:14:01 AM1/7/22
to Kill Bill users mailing-list
We're working in a Killbill upgrade but this line is causing a bug to us:

https://github.com/killbill/killbill/blob/2146e833d262150ff52524b5d93662f6b4fd0354/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java#L365

if (hasTransactionChanged || retrySMHelper.getInitialState().getName().equals(paymentAttemptModelDao.getStateName())) {

Since this piece of code is using OR, doesn't matter if payment transaction hasn't changed, it will attempt to update a payment attempt associated to this transaction if the payment attempt is on INIT state.

The error I'm facing is that Janitor is overriding my Plugin Properties on payment attempt because it's not "waiting" to the payment plugin to finish updating/creating a new payment transaction + payment attempt.
I tried changing it to "&&" and this solved my problem since now Janitor will wait until the payment transaction has change to correctly update payment attempt if needed.

So, here comes the questions:

1) Why are we using OR instead?
2) It will be a problem changing it?

Thank you!
Reply all
Reply to author
Forward
0 new messages