Paypal IPN fails when contact is merged
Some contacts, when they sign up to a Paypal recurring contribution on our online forms, use details which which do not exactly match what we already have for them in Civi, so a new contact is created at that time. We have volunteers which search for such duplicates and merge them back into the original contact.
But the IPN details do not change. The IPN still sends back the information with the contact ID set to the duplicated ID, so then Civi refuses to process it and gives the message "Could not find contact record: 123456 in IPN request". So these contacts end up never having their transactions recorded in Civi as a result.
The Paypal IPN details cannot be altered. But people's contact ID do sometimes change, so Civi must take this into account. One of the details in the IPN, the Contribution Recur ID, is actually correct (as is the Contribution ID of the original contribution). So a possible solution might be for Civi to look at those details instead and infer the correct contact ID to record the new transaction.