-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Messenger for RUN_BLOCK_*
methods
#2090
Conversation
@twschiller this may be good to go but first it's probably best for you to do some additional tests (especially for the server and UiPath) and review the Concerns section above. |
} | ||
|
||
return data; | ||
return requestRun.onServer(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this change the return type? The old code destructured data to get the {data, error}? (Since IIRC the server will return 200 even on block error, since the request itself succeeded)
- Confirm onServer return type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I somehow missed the executor diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I moved this into the background handler.
No worries, diffs aren't always immediately clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually part of the Concerns section and it's something I'd like you to test with the server.
@@ -79,8 +79,12 @@ export const dataStore = { | |||
set: getMethod("SET_DATA_STORE", bg), | |||
}; | |||
|
|||
export const executeBrick = { | |||
onServer: getMethod("EXECUTE_ON_SERVER", bg), | |||
export const requestRun = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not the biggest fan of the word "request" here because it make me think "network request" and only the REQUEST_RUN_ON_SERVER message would make a request
Any reason to use request here vs. execute (or another word)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suppose that they could all use RUN_IN_*
and then keep RUN_BRICK
for the final call. I was just trying to differentiate the forwarder from the final call, as mentioned in the first post.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm return type for execute on server
Looks good, will make sure to test in more detail during QA/Rainforest tests. Main comment is I'm not the biggest fan of the name "requestRun", but we can always revisit that later |
executeInTarget
#2044Context
As mentioned in the previous PR, I'm replacing the previous sendMessage calls to Messenger, but the forwarding is done manually (due to custom logic), i.e. the reducer messages the background and then the background messages the desired target.
Naming
For consistency, I named these two messages differently:
and also ensured that they're always called BRICK and not BLOCK.
Test status
Refactoring
Concerns
retrySend
was called in the source tab towards the background. This is currently missing, but if needed it should run in the background page because connection to the background is guaranteed (by the messenger’s own retries), it shouldn't need to retry.RemoteExecutionError
was created in the source tab, but now it's generated and serialized in the background page. By the looks of it, none of the checks useinstanceof
to check this error..name === 'RemoteExecutionError'
works correctly.Demo (opener)
Screen.Recording.1.mov