Skip to content

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

Merged
tvdeyen merged 1 commit into
solidusio:mainfrom
blish:logentry-lazy-parse
Aug 6, 2026
Merged

feat(log_entry): write details unparsed and validate on read#6530
tvdeyen merged 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.

@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.14%. Comparing base (50f6fe1) to head (d4066c9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6530   +/-   ##
=======================================
  Coverage   92.14%   92.14%           
=======================================
  Files        1035     1035           
  Lines       21149    21151    +2     
=======================================
+ Hits        19488    19490    +2     
  Misses       1661     1661           

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

@tvdeyen
tvdeyen force-pushed the logentry-lazy-parse branch from ba412b5 to fb69c78 Compare August 4, 2026 19:10
@mamhoff

mamhoff commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Needs a manual rebase.

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 force-pushed the logentry-lazy-parse branch from fb69c78 to d4066c9 Compare August 6, 2026 13:57
@tvdeyen
tvdeyen merged commit 19725df into solidusio:main Aug 6, 2026
39 checks passed
@tvdeyen
tvdeyen deleted the logentry-lazy-parse branch August 6, 2026 14:10
@tvdeyen

tvdeyen commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Done

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.

3 participants