Skip to content

chore: Add more context to submission failure log#74

Closed
zeljkoX wants to merge 1 commit intomainfrom
submit-log-improvement
Closed

chore: Add more context to submission failure log#74
zeljkoX wants to merge 1 commit intomainfrom
submit-log-improvement

Conversation

@zeljkoX
Copy link
Contributor

@zeljkoX zeljkoX commented Feb 17, 2026

This PR will add more context to submission failure logs

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Enhanced error reporting for failed transactions to include specific error codes and fee charge details.
    • Improved diagnostic information in transaction failure messages for better troubleshooting.
  • Tests

    • Expanded test coverage for transaction result decoding and error message handling scenarios.

Copilot AI review requested due to automatic review settings February 17, 2026 09:15
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This PR introduces SubmitContext, a data structure carrying contract identification and fee-bump limitation status, through the submission flow. The handler extracts contractId from transactions and determines if they're limited, passing this context to submitWithFeeBumpAndWait for enhanced error handling and logging.

Changes

Cohort / File(s) Summary
Context Integration in Handler
src/plugin/handler.ts
Integrates SubmitContext into submission flow by extracting contractId from XDR or func signatures and determining isLimited status based on acquireOptions, then passing constructed context to submitWithFeeBumpAndWait.
Enhanced Error Decoding in Submit
src/plugin/submit.ts
Adds SubmitContext type, updates submitWithFeeBumpAndWait signature to accept optional context, introduces decodeTransactionResult helper to extract and unwrap XDR-encoded transaction results with fee and resultCode details for improved error logging.
Test Coverage
test/error-sanitization.test.ts
Adds test suite for decodeTransactionResult covering insufficient fee scenarios, nested failure unwrapping, and invalid input handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • tirumerla

Poem

🐰 A hop through the fee bump flow,
With context now helps us to know,
Which contracts are limited, tight,
When errors arise in the night,
We decode and log with bright glow!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective—adding context to submission failure logs. It matches the actual changes where submission error handling is enhanced with contextual information like contractId, contractType, and maxFee.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch submit-log-improvement

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds richer, structured error logging for transaction submission failures by extracting contract context (contractId + limited/default classification) and decoding Stellar transaction result XDR when available.

Changes:

  • Extend submitWithFeeBumpAndWait to accept an optional SubmitContext and log contract/fee details on failure.
  • Add decodeTransactionResult helper to parse TransactionResult XDR from status_reason strings (including fee-bump inner-failure unwrap).
  • Add Vitest coverage for decodeTransactionResult.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/plugin/submit.ts Adds context-aware failure logging and implements decodeTransactionResult XDR decoding helper.
src/plugin/handler.ts Plumbs contractId and limited/default contract classification into submit logging via SubmitContext.
test/error-sanitization.test.ts Adds unit tests validating decodeTransactionResult behavior across success/invalid cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zeljkoX zeljkoX closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants