Skip to content

feat(log_entry): write details unparsed and validate on read - #6530

Open
tvdeyen wants to merge 1 commit into
solidusio:mainfrom
blish:logentry-lazy-parse
Open

feat(log_entry): write details unparsed and validate on read#6530
tvdeyen wants to merge 1 commit into
solidusio:mainfrom
blish:logentry-lazy-parse

Conversation

@tvdeyen

@tvdeyen tvdeyen commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

Recording a payment response creates a Spree::LogEntry, and the log entry serialized the response through YAML.safe_dump. That validated permitted classes at write time and degraded any response it could not serialize, losing the real gateway data. The untrusted boundary is the database read, not the write of our own response, so the log entry now stores the response with a plain YAML.dump and defers the safe_load validation to when parsed_details is read.

The exception behind such a fallback is now reported via Rails.error so it stays visible to developers instead of being silently swallowed.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

Recording a payment response creates a Spree::LogEntry, and the log
entry serialized the response through YAML.safe_dump. That validated
permitted classes at write time and degraded any response it could not
serialize, losing the real gateway data. The untrusted boundary is the
database read, not the write of our own response, so the log entry now
stores the response with a plain YAML.dump and defers the safe_load
validation to when parsed_details is read.

The exception behind such a fallback is now reported via Rails.error so
it stays visible to developers instead of being silently swallowed.
@tvdeyen
tvdeyen requested a review from a team as a code owner July 31, 2026 10:54
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (e6705cb) to head (ba412b5).
⚠️ Report is 1403 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6530      +/-   ##
==========================================
+ Coverage   89.66%   92.38%   +2.71%     
==========================================
  Files         990       42     -948     
  Lines       20792      788   -20004     
==========================================
- Hits        18644      728   -17916     
+ Misses       2148       60    -2088     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant