You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The emulator/core package is responsible for the REST server that emulates both the DirectLine service and the back end of the "channel."
This package also contains a per-session storage layer (in memory) that keeps track of everything the "channel" cares about: Current users, bot state, conversations, activities within conversations, etc. However, the only way to see into this storage layer and manipulate it is from the main process of the application. This means that reading or writing to this layer from the renderer process requires the use of IPC.
The Solution
We can leverage the fact that there is no network latency between the renderer and main processes of the Emulator to allow us to perform CRUD operations on the channel storage layer, as well as many other main process functions. This can be done by exposing an API that can be hit directly from the renderer process using fetch.
This will allow us to declaratively start new conversations, get activities for a conversation, and even do things like check for application updates.
I believe that the source for the code package can also be trimmed down and moved into the app/main package, because it is slightly confusing in its current state.
Pros:
Exposes the "channel" storage layer to the renderer process directly through an API instead of having to go through Electron's IPC
Has the potential to also map other main process functionality to the API (checking for application updates, reading / writing from disk, interacting with ngrok, etc)
If functionality is mapped to a REST server, then we can use Restify's 'after' route handler to generate an audit log of what the application was doing to help debug crashes & errors
Cons:
Affected code is pivotal for the core scenarios of the Emulator
Significant code churn on the main side
Lack of pre-existing e2e testing for core functionality to compare against when complete
The text was updated successfully, but these errors were encountered:
The Problem
The
emulator/core
package is responsible for the REST server that emulates both the DirectLine service and the back end of the "channel."This package also contains a per-session storage layer (in memory) that keeps track of everything the "channel" cares about: Current users, bot state, conversations, activities within conversations, etc. However, the only way to see into this storage layer and manipulate it is from the main process of the application. This means that reading or writing to this layer from the renderer process requires the use of IPC.
The Solution
We can leverage the fact that there is no network latency between the renderer and main processes of the Emulator to allow us to perform CRUD operations on the channel storage layer, as well as many other main process functions. This can be done by exposing an API that can be hit directly from the renderer process using
fetch
.This will allow us to declaratively start new conversations, get activities for a conversation, and even do things like check for application updates.
I believe that the source for the code package can also be trimmed down and moved into the
app/main
package, because it is slightly confusing in its current state.Pros:
'after'
route handler to generate an audit log of what the application was doing to help debug crashes & errorsCons:
core
functionality to compare against when completeThe text was updated successfully, but these errors were encountered: