Skip to content

Add persistent pending-transaction tracking with local notifications#60

Open
Jim8y wants to merge 3 commits into
neoorder:masterfrom
Jim8y:codex/pending-tx-notifications
Open

Add persistent pending-transaction tracking with local notifications#60
Jim8y wants to merge 3 commits into
neoorder:masterfrom
Jim8y:codex/pending-tx-notifications

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What

A PendingTransactionService (DI singleton) that tracks each broadcast transaction to a terminal state and raises an OS local notification on confirm/fail.

Unlike SendingPage's in-page poll (which is cancelled the moment you leave the page), this:

  • Survives navigation, backgrounding and relaunch — tracking lives for the app process and the pending list is persisted in the existing Settings key-value store (transactions/pending), resumed on startup.
  • Verifies execution result via getapplicationlog + VMState.HALT (a reverted FAULT tx notifies as failed, not succeeded).
  • Delivers via the OS so the user learns the outcome even after leaving the Send screen.

How

  • New Services/PendingTransactionService.cs; registered as a singleton in MauiProgram.
  • Plugin.LocalNotification 14.1.1 (net10.0-compatible) + builder.UseLocalNotification().
  • Android POST_NOTIFICATIONS permission; startup requests notification permission and resumes pending tracking (App ctor).
  • Enqueues on broadcast in SendPage/SendNFTPage.

Verified

Builds clean for net10.0-android (0 errors; the 6 warnings are pre-existing SQLitePCLRaw NU1903 advisories). iOS/maccatalyst not buildable in this environment (no Xcode), but the platform specifics are handled by Plugin.LocalNotification.

Scope / notes

…tions

Add a PendingTransactionService (DI singleton) that tracks broadcast transactions
to a terminal state (HALT/FAULT) and raises a local notification on confirm/fail.
Unlike SendingPage's in-page poll, tracking lives for the app process and is
persisted in the existing Settings store, so it survives navigation, backgrounding
and relaunch. Wires Plugin.LocalNotification, POST_NOTIFICATIONS, startup permission
request + resume, and enqueues on send (SendPage/SendNFTPage).

Builds for net10.0-android (0 errors).
Copilot AI review requested due to automatic review settings June 21, 2026 11:01

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

Adds an app-wide, persisted pending-transaction tracker that continues confirmation polling beyond the Send flow and surfaces final outcomes via OS local notifications.

Changes:

  • Introduces PendingTransactionService (singleton) to persist and resume tracking of broadcast tx hashes and poll RPC until a terminal state.
  • Integrates Plugin.LocalNotification (builder + Android permission) and requests notification permission at startup.
  • Enqueues pending tracking after broadcasting transactions from SendPage and SendNFTPage, and adds TransactionFailed localized string.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
OneGateApp/Services/PendingTransactionService.cs New persisted polling loop + local-notification dispatch for tx confirm/fail outcomes
OneGateApp/Properties/Strings.resx Adds TransactionFailed base string
OneGateApp/Properties/Strings.zh-Hans.resx Adds Simplified Chinese TransactionFailed
OneGateApp/Properties/Strings.zh-Hant.resx Adds Traditional Chinese TransactionFailed
OneGateApp/Properties/Strings.Designer.cs Adds Strings.TransactionFailed accessor
OneGateApp/Platforms/Android/AndroidManifest.xml Declares POST_NOTIFICATIONS permission
OneGateApp/Pages/SendPage.xaml.cs Enqueues tx hash for background tracking after broadcast
OneGateApp/Pages/SendNFTPage.xaml.cs Enqueues tx hash for background tracking after broadcast
OneGateApp/OneGateApp.csproj Adds Plugin.LocalNotification package reference
OneGateApp/MauiProgram.cs Registers plugin + DI singleton for pending tracking
OneGateApp/App.xaml.cs Starts pending-tracking service on app startup
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/Services/PendingTransactionService.cs
Comment thread OneGateApp/Services/PendingTransactionService.cs
Comment thread OneGateApp/Services/PendingTransactionService.cs Outdated
Comment thread OneGateApp/Services/PendingTransactionService.cs
Comment thread OneGateApp/Services/PendingTransactionService.cs
@Jim8y

Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Handled the open #60 review threads.

Changes:

  • Wrapped StartAsync() in a top-level best-effort guard so startup cannot fail because pending tracking could not restore local state.
  • Serialized polling-loop creation with loopLock, so concurrent enqueue/start paths cannot create duplicate polling loops.
  • Replaced in-memory attempt cutoff with CreatedAt + a 10-minute age limit, so timeout behavior survives app relaunch.
  • Split raw-transaction polling from application-log resolution: if the tx is in a block but the application log is missing or malformed, it now falls back to confirmed/unknown instead of sending a false failure notification.
  • Replaced process-randomized string.GetHashCode() notification ids with a deterministic SHA-256-derived positive int.
  • Added a background-loop top-level guard to avoid unobserved task exceptions from best-effort polling work.
  • Added TransactionFailed to the remaining locale files; resource parity is now 15 files / 284 keys.
  • Merged current origin/master into the branch with no conflicts.

Validation:

  • git diff --check
  • Conflict scan with rg -n "<<<<<<<|=======|>>>>>>>" OneGateApp
  • Resource parity checked: 15 resource files, 284 keys
  • iOS simulator build/install/launch verified; notification permission prompt appeared as expected, then Wallet -> Send UI verified on the final build
  • Android emulator build/install/launch verified, then Wallet -> Send UI verified on the final build
  • Android crash buffer remained empty after launch and navigation

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