lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Fix missed responses for validation errors #185

Closed lorenzodonini closed 1 year ago

lorenzodonini commented 1 year ago

The bug discovered in https://github.com/lorenzodonini/ocpp-go/issues/175 would cause responses not being sent out to the original endpoint, making debugging such cases difficult and potentially leading to starvation.

With the PR, the following behavior is introduced in v1.6 and v2.0.1:

These functionalities are covered by the HandleFailedResponseError method, added to both endpoints within the ocpp-j layer. The function is invoked by the actual ocpp16 and ocpp2 protocol packages.

Note: the introduced behavior will be run only once. If the HandleFailedResponseError method fails, no further retransmission attempts will be made.