Make the AsyncOperationsPanel a live submission queue driven by real contract operations#496
Open
Menjay7 wants to merge 3 commits into
Open
Make the AsyncOperationsPanel a live submission queue driven by real contract operations#496Menjay7 wants to merge 3 commits into
Menjay7 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Transform AsyncOperationsPanel from a static or mock-driven component into a real-time submission queue powered by actual contract operations.
This PR introduces live tracking of contract submissions, displaying their lifecycle from initiation through confirmation or failure, and providing users with immediate visibility into ongoing asynchronous activities.
Problem
The current AsyncOperationsPanel does not reflect real contract activity:
Operations are placeholder or locally simulated.
Users cannot monitor actual contract submissions.
Status updates are disconnected from blockchain execution state.
Failed and pending operations are difficult to diagnose.
The UI lacks a reliable source of truth for asynchronous actions.
Solution
Connect AsyncOperationsPanel directly to contract operation events and maintain a live queue of in-flight and completed submissions.
Features
Live Submission Queue
Track real contract operations in real time:
Queue
├── Operation A → Pending
├── Operation B → Submitting
├── Operation C → Confirmed
└── Operation D → Failed
Supported States
Queued
↓
Submitting
↓
Pending Confirmation
↓
Confirmed
└── Failed
Real-Time Updates
New contract submissions appear immediately.
Status changes propagate automatically.
Completed operations remain visible for inspection.
Failed operations surface actionable error information.
Queue ordering remains deterministic.
Implementation Details
Operation Source Integration
Wire the panel to real contract activity:
Contract submission events
Transaction hashes and identifiers
Confirmation and finalization events
Failure and rejection notifications
Retry or resubmission events where applicable
Queue State Management
Introduce centralized queue management:
Contract Operation
↓
Operation Store
↓
AsyncOperationsPanel
↓
Real-Time UI Updates
Operation Metadata
Each queue item displays:
Operation type
Submission timestamp
Current status
Transaction identifier
Error details when applicable
UI Improvements
Pending Operation
Deploy Contract
Status: Pending Confirmation
Tx: abc123...
Successful Operation
Transfer Funds
Status: Confirmed
Tx: def456...
Failed Operation
Rotate Treasury
Status: Failed
Reason: Insufficient authorization
Error Handling
Gracefully handle:
Contract submission failures
Network interruptions
Missing transaction receipts
Duplicate operation events
Reconnection and event replay scenarios
Unexpected provider errors
State Synchronization
Ensure:
Operations are deduplicated.
Updates are applied idempotently.
Queue ordering remains stable across refreshes.
State can recover after reconnects.
Historical operations remain consistent.
Testing
Added tests covering:
Queue Behavior
Operations are added on submission.
Status transitions update correctly.
Queue ordering remains deterministic.
Duplicate events are ignored.
Real-Time Updates
Confirmation events update existing entries.
Failure events transition operations correctly.
Reconnection restores operation state.
Event replay remains idempotent.
UI States
Empty queue rendering.
Pending operations.
Confirmed operations.
Failed operations.
Multiple simultaneous submissions.
Error Conditions
Missing transaction data.
Provider failures.
Partial event streams.
Invalid operation payloads.
Benefits
Provides users with immediate visibility into real contract activity.
Eliminates discrepancies between UI state and blockchain state.
Improves debugging and operational transparency.
Reduces uncertainty during long-running transactions.
Establishes a foundation for notifications, retry actions, and operation history.
Breaking Changes
AsyncOperationsPanel now relies on real contract operation events instead of placeholder data.
Consumers using mock operation APIs may need to migrate to the new operation store and event-driven interfaces.
Tests depending on static panel content will require updates.
Closes: Replace the placeholder AsyncOperationsPanel implementation with a live, event-driven submission queue powered by real contract operations.closed #478