There is an issue with the _uc_recurring_hosted_paypal_ipn_save() method.

This method is using drupal_write_record() to store the $ipn object (uc_payment_paypal_ipn) into database. Problem is that in the definition there is a "status" field whereas in the object itself it is a "payment_status". So at this point it fails to store IPN status like Completed or Pending which is important for a following scenario:

1) New "Pending" IPN
- it changes order status
- stores ipn

2) New "Completed" IPN (same txn_id, different status)
- _uc_recurring_hosted_paypal_ipn_is_duplicate() returns true - as it depends on previous statuses
- it ends with the "has been processed before" message

Solution:

// Use correct fild for the status
if (!isset($ipn->status) && isset($ipn->payment_status)){
	$ipn->status = $ipn->payment_status;
}

//save our ipn transaction
_uc_recurring_hosted_paypal_ipn_save($ipn);