solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Spree::LogEntry#parsed_details raises on missing legacy class definition

Open spaghetticode opened this issue 2 years ago • 3 comments

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

Screenshot 2023-02-10 at 14 51 41

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.

spaghetticode avatar Feb 10 '23 13:02 spaghetticode

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 avatar Feb 10 '23 14:02 kennyadsl

@kennyadsl I confirm you the issue is still present in master.

spaghetticode avatar Feb 10 '23 15:02 spaghetticode

@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.

waiting-for-dev avatar Feb 13 '23 04:02 waiting-for-dev