Skip to content
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

Merged
merged 1 commit into from
Jul 19, 2016

Conversation

carystanley
Copy link
Contributor

@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.

@yahoocla
Copy link

CLA is valid!

@mridgway mridgway added the ready label Jul 18, 2016
@lingyan
Copy link
Member

lingyan commented Jul 18, 2016

@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);
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

@carystanley
Copy link
Contributor Author

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.

@mridgway
Copy link
Collaborator

Makes sense to me for now 👍

I think some of this logic may change as a result of #444

@lingyan lingyan merged commit fe7694a into yahoo:master Jul 19, 2016
@lingyan lingyan removed the ready label Jul 19, 2016
@lingyan
Copy link
Member

lingyan commented Jul 19, 2016

@carystanley fluxible-plugin-devtools v0.1.5 released with this fix. Thanks for your contrib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants