chore: restart bot on network error #214
Draft
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.
This pull request includes several changes to improve the initialization process and logging for the API, as well as some updates to the bot's behavior. The most important changes include renaming the
init
method toinitApi
, adding extensive logging, and modifying the bot's initialization and interpreter methods.API Initialization and Logging Improvements:
src/app/app-root.tsx
: Renamedapi_base.init
toapi_base.initApi
for better clarity.src/components/layout/header/account-switcher.tsx
: Updated the method call fromapi_base?.init
toapi_base?.initApi
.src/external/bot-skeleton/services/api/api-base.ts
: Renamed theinit
method toinitApi
, added logging for WebSocket events, and implemented a debounced reconnection mechanism. [1] [2] [3]Bot Initialization and Interpreter Updates:
src/external/bot-skeleton/scratch/dbot.js
: Added logging statements ininitWorkspace
andinitializeInterpreter
methods to aid in debugging. [1] [2]src/pages/main/main.tsx
: Commented out the bot stopping logic in the connection status check to prevent unnecessary interruptions.Other Changes:
src/external/bot-skeleton/services/api/appId.js
: Commented out the creation of a WebSocket connection and modified thegenerateDerivApiInstance
function.src/stores/app-store.ts
: Added logging in theonMount
andonUnmount
methods to track the lifecycle of the app store. [1] [2]