-
Notifications
You must be signed in to change notification settings - Fork 228
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
Fix to devtools-plugin to support Actions without a "callback" param #460
Conversation
CLA is valid! |
@mridgway Any thoughts about this? |
@@ -144,6 +144,10 @@ export default function devToolsPlugin() { | |||
return action(ctx, payload, cb); | |||
} | |||
|
|||
function timedActionNoCallback(ctx, payload) { | |||
return timedAction(ctx, payload); |
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.
You might want to call these two lines before returning timedAction
actionReference.startTime = Date.now();
actionReference.payload = JSON.stringify(payload);
Without a start time these actions might not end up in the correct place in the timeline. The payload will also be useful for debugging actions called w/o a callback.
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.
The call to "timedAction" sets those values already
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.
It seemed to show up in the correct place in the timeline for me
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.
Ah, you're right, I thought you were directly calling the action just w/o a callback.
Current behavior is that request crashes/hangs for actions that don't implement the "callback" param and use devtools-plugin, so this would be a big improvement. |
Makes sense to me for now 👍 I think some of this logic may change as a result of #444 |
@carystanley fluxible-plugin-devtools v0.1.5 released with this fix. Thanks for your contrib! |
@lingyan @redonkulus
This should resolve the issue where calling executeAction on actions that do not contain a "callback" param while using devtools-plugin causes the request to hang.