fix: assets reinitialization on TradeRouterService rpc re-connection and minor UI fixes#28
Conversation
…rvice - Updated the error handling in the TradeRouterService to utilize a new `fullCleanup` method, ensuring a more thorough reset of the service state upon initialization failure. This change improves the reliability of the service by ensuring that all relevant properties are reset, preventing potential issues from lingering state. - The `cleanup` method has been modified to preserve the `lastInitializedAssets`, allowing for potential reinitialization without losing previously stored data. This design choice balances the need for a clean state with the efficiency of retaining useful information for future operations. - Additionally, clarified comments in the `ConnectionManager` to indicate that observer notifications are now handled in the `connectToNetwork` method, reducing the risk of race conditions and improving code maintainability.
…ability - Introduced a new script, `test-connection-resilience.ts`, to systematically test the connection resilience of the application. This script simulates connection drops and reconnections, ensuring that the system can handle network instability effectively. - The testing process includes multiple phases: initial setup, connection drop simulation, reconnection handling, and functionality verification of the TradeRouter. This comprehensive approach allows for thorough validation of the connection management logic and asset preservation during network disruptions. - Additionally, enhancements were made to the `initializeSDK` method to ensure that the TradeRouter can initialize independently of external assets, improving its robustness during startup. The `FetchAssetService` was also updated to include better error handling and checks for the availability of the TradeRouter, ensuring that asset enrichment processes are resilient to initialization states.
Member
Author
|
bugbot run |
- Introduced a `restorationTimeoutId` property to manage restoration timeouts effectively, preventing race conditions during network reconnections. This change ensures that any pending restoration processes are canceled before initiating a new one, improving the reliability of the service. - Removed the `lastInitializedAssets` array, as it is no longer necessary to store external assets, simplifying the state management within the service. This decision aligns with the goal of maintaining a self-contained initialization process for the TradeRouter. - Updated the `cleanup` and `fullCleanup` methods to consistently clear the restoration timeout, ensuring a clean state during service resets. These modifications enhance the overall maintainability and robustness of the TradeRouterService, allowing for smoother operation during network fluctuations.
Member
Author
|
bugbot run |
Member
Author
|
bugbot run |
Member
Author
|
bugbot run |
1 similar comment
Member
Author
|
bugbot run |
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.
No description provided.