Skip to content

Report transaction failure when execution reverts#58

Open
Jim8y wants to merge 2 commits into
neoorder:masterfrom
Jim8y:codex/fix-tx-fault-detection
Open

Report transaction failure when execution reverts#58
Jim8y wants to merge 2 commits into
neoorder:masterfrom
Jim8y:codex/fix-tx-fault-detection

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Problem

SendingPage reports success as soon as the transaction has a blocktime — i.e. on block inclusion. But a transaction can be included in a block and still revert (VMState.FAULT), so a failed transaction was shown as "Transaction succeeded", with no failure state at all.

Fix

After blocktime appears, call getapplicationlog and require executions[0].vmstate == HALT before reporting success; otherwise show an explicit failed state (red icon + 'Transaction failed' + red status). If the application log can't be read, fall back to confirmed to avoid a false failure.

Reuses VMState and getapplicationlog already present in the repo — no new dependency. Adds TransactionFailed/Failed strings in all three locales.

Verified by static review (no MAUI workload locally); please confirm in CI.

SendingPage reported success as soon as the transaction got a blocktime, i.e. on
block inclusion. A transaction can be included in a block yet revert (VMState.FAULT),
so a failed transaction was shown as 'TransactionSucceeded'. After block inclusion,
query getapplicationlog and require executions[0].vmstate == HALT before reporting
success; render an explicit failed state otherwise. Reuses VMState already in the repo;
no new dependency.
Copilot AI review requested due to automatic review settings June 21, 2026 10:29

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 updates the transaction “sending/confirmation” UI so it only reports success after block inclusion and a successful execution result (getapplicationlog with vmstate == HALT), and adds localized strings for the new failure state.

Changes:

  • Add a tri-state execution result (Succeeded: bool?) and derive IsConfirming / IsSucceeded / IsFailed for UI binding.
  • After blocktime appears, query getapplicationlog and show a failure state when execution is not HALT.
  • Introduce new localization keys (Failed, TransactionFailed) and expose them via Strings.Designer.cs.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
OneGateApp/Pages/SendingPage.xaml.cs Adds execution-state tracking and queries getapplicationlog after block inclusion.
OneGateApp/Pages/SendingPage.xaml Updates UI bindings to show confirming/success/failure states and adds failure visuals.
OneGateApp/Properties/Strings.resx Adds new neutral-language strings for failure state.
OneGateApp/Properties/Strings.zh-Hans.resx Adds Simplified Chinese strings for failure state.
OneGateApp/Properties/Strings.zh-Hant.resx Adds Traditional Chinese strings for failure state.
OneGateApp/Properties/Strings.Designer.cs Exposes new resource keys as strongly-typed properties.
Files not reviewed (1)
  • OneGateApp/Properties/Strings.Designer.cs: Generated file

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

Comment thread OneGateApp/Pages/SendingPage.xaml.cs
Comment thread OneGateApp/Properties/Strings.resx
@Jim8y

Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Handled the open #58 review threads.

Changes:

  • QueryExecutionSucceededAsync now treats RpcException, HttpRequestException, and JsonException as application-log unavailable. That keeps confirmed-but-unknown execution results from being shown as false failures.
  • Added Failed and TransactionFailed to all locale resource files so the new keys are complete across the app.

Validation:

  • git diff --check
  • Conflict scan with rg -n "<<<<<<<|=======|>>>>>>>" OneGateApp
  • Resource parity checked: 15 resource files, 285 keys
  • iOS simulator build/install/launch verified, then Wallet -> Send UI verified
  • Android emulator build/install/launch verified, then Wallet -> Send UI verified
  • Android crash buffer remained empty after launch and navigation

Known limitation:

  • A real reverted on-chain execution still needs a failing transaction on network. Simulator validation covers startup, navigation, send-entry UI, resource coverage, and the guarded code path.

Screenshots:

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants