solidus
solidus copied to clipboard
Spree::LogEntry#parsed_details raises on missing legacy class definition
Solidus Version: Master
Current behavior
If a payment log entry is old enough to include in its response details a class that doesn't exist anymore, a 500 server error is raised when viewing the payment in the admin area.
As real-world example, we can consider the class Braintree::Transaction::AndroidPayDetails
which was removed with Braintree v3.0 in favor of Braintree::Transaction::GooglePayDetails
.
Expected behavior
The specific payment page is still accessible.
Screenshots

Additional context
Depending on the complexity of the desired solution, we may prefer to simply ignore the log entry or try to show it someway, for example by rendering the raw YAML in a collapsed form so its large amount of data doesn't clutter the page but is still accessible for interested parties.
This method changed in the latest Solidus versions. Are you sure we are still affected?
If yes, We need to find a proper long-term solution to this, and I think it's safe to rescue NameError around const_get
and show different information when that happens. As a temporary workaround, can you define a fake class with the same name?
@kennyadsl I confirm you the issue is still present in master.
@kennyadsl, in https://github.com/solidusio/solidus/commit/1f7442f3c44c16225c0ed24f5c515e2a189a77f5 we fixed a different issue. If the class is not present anymore, that's another problem. We should check whether psych supports something OOTB and, otherwise, rescue from our side.