Friday, February 21, 2025
1 change · 17.0
Resolved issues and error corrections
This fix gives the Romanian SPV service more time to respond before Odoo treats a request as failed, reducing the chance that users resend the same invoice and create duplicates. It also improves user visibility by logging timeout and request errors on the invoice chatter, and handles invalid access token responses more clearly.
Original PR description
The Romanian SPV servers are slow. When sending a request to them, we previously set a hard timeout limit at 10 seconds and mark the request as failed if it exceeds it. However, recently we have…
The Romanian SPV servers are slow. When sending a request to them, we previously set a hard timeout limit at 10 seconds and mark the request as failed if it exceeds it. However, recently we have found a critical issue where some users found that their invoice has been sent twice (or more) to the Romanian SPV. After investigating, we found that what's likely to happen is that the SPV takes more than 10 seconds to send the response back when we're making a request, and since in our side we consider the request as failed and requires the user to send a new request again, we make the user send a second request on the same invoice, where the SPV actually acknowledges all of the received invoices. After discussing with the PO, a temporary workaround for now is to increase the timeout limit to 60 seconds (1 full minute) to reduce the likelihood of this issue happening, and log error messages on the chatter if the request (either for send/fetch/download) failed, so that the user are aware when it is timeout and be more wary not to send another request right away, in case the new timeout limit are still not enough. Other small changes in this PR: - Handle response code 401, (which is a JSON object, invalid access token) - Remove the "Error when sending the document to the SPV:" template in error documents (because not all error documents are for sending, some are from fetch/download) opw-4571713