Skip to content

feat: friendlyError Extended with Soroban XDR Diagnostic Extraction and Error Telemetry Hook#565

Open
enniedokz wants to merge 5 commits into
SiLioLabs:masterfrom
enniedokz:XDR-Diagnostic
Open

feat: friendlyError Extended with Soroban XDR Diagnostic Extraction and Error Telemetry Hook#565
enniedokz wants to merge 5 commits into
SiLioLabs:masterfrom
enniedokz:XDR-Diagnostic

Conversation

@enniedokz

Copy link
Copy Markdown

Close #454
Close #456
Close #490
Close #500

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@enniedokz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve frontend error reporting for Soroban simulation failures by introducing parseContractError, wiring it into the transaction build/simulation flow, and adding an error-telemetry hook plus an end-to-end Vitest integration test for the subscribe → pay-per-use → cancel journey. It also includes a few contract-side fixes/adjustments (subscription struct cloning, grace-period governance call updates, and a contract error enum update), along with dependency/lockfile updates.

Changes:

  • Frontend: add parseContractError + new useErrorTelemetry() hook; integrate parsing into simulation/build paths.
  • Frontend: add an end-to-end integration test with Freighter + Stellar mocks for subscribe → pay-per-use → cancel.
  • Contract: minor subscription cloning changes, grace-period propose/commit usage in tests, and error enum adjustments.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
package.json Adds root-level TypeScript dependency (potentially redundant vs frontend/).
package-lock.json Lockfile updates for new root dependency.
frontend/src/utils/errors.ts Extends CONTRACT_ERRORS and adds parseContractError().
frontend/src/test/errors.test.ts Adds unit tests for parseContractError().
frontend/src/stellar.ts Integrates contract error parsing into simulation/build flows; refactors some helpers.
frontend/src/hooks/useStellarBalance.ts Updates getBalance call signature usage.
frontend/src/hooks/useErrorTelemetry.ts Adds telemetry hook that counts payflow:error CustomEvents.
frontend/src/components/SubscriptionHistory.tsx Minor comment removal in UI component.
frontend/src/components/SubscriptionCard.tsx Adds optional onCancel/onPause hooks and updates cancel button behavior.
frontend/src/components/PayPerUseForm.tsx Cleans up duplicated/incorrect imports.
frontend/src/components/Dashboard.tsx Moves cancellation confirmation to Dashboard-level modal and adds keyboard shortcut handling.
frontend/src/tests/stellar.test.ts Updates fetchEvents test expectations to match return shape usage.
frontend/src/tests/integration/subscribe-pay-cancel.test.tsx Adds full integration test with fake timers and mocked infrastructure.
frontend/src/tests/mocks/stellar.ts Adds a manual mock module for Stellar interactions used by tests.
frontend/src/tests/mocks/freighter.ts Adds a manual Freighter wallet mock used by tests.
frontend/package-lock.json Frontend lockfile changes (dependency graph adjustments).
contract/src/test.rs Updates grace period test to use propose/commit flow; minor variable naming tweak.
contract/src/lib.rs Avoids moves by cloning addresses when building/storing subscriptions.
contract/src/grace.rs Adds set_grace_period storage + TTL extension and cleans up whitespace.
contract/src/events.rs Removes duplicate stubbed publish_paused definition.
contract/src/errors.rs Adjusts/extends ContractError enum discriminants and adds MetadataLabelTooLong.
Files not reviewed (1)
  • frontend/package-lock.json: Generated file

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

Comment thread frontend/src/stellar.ts Outdated
Comment thread frontend/src/stellar.ts
Comment thread frontend/src/stellar.ts
Comment thread frontend/src/utils/errors.ts
Comment thread frontend/src/test/errors.test.ts
Comment thread frontend/src/hooks/useErrorTelemetry.ts
Comment thread frontend/src/__tests__/__mocks__/stellar.ts
Comment thread frontend/src/__tests__/integration/subscribe-pay-cancel.test.tsx
Comment thread package.json
Comment thread contract/src/lib.rs
orunganiekan and others added 2 commits July 1, 2026 11:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment