Skip to content

Conversation

@svizzari
Copy link
Contributor

@svizzari svizzari commented Jul 11, 2016

✌️

/cc @zendesk/vegemite

Description

Where a Save Hook handler was returning immediately, rather than a Promise, the rules governing Save Hook return values weren't being respected.

References

JIRA: https://zendesk.atlassian.net/browse/AF-387

TODO

Risks

  • [low] Save Hook allowing Ticket Save when not intended, or vice-versa

@danielbreves
Copy link
Contributor

danielbreves commented Jul 11, 2016

👍 with regression test

lib/utils.js Outdated
} else if (isFalsy(res)) {
promise = Promise.reject(res);
} else {
promise = new Promise(function(resolve) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise.resolve, if i want to be a stickler

@adammw
Copy link
Contributor

adammw commented Jul 11, 2016

👍

promise = new Promise(function(resolve) {
resolve(res);
});
promise = Promise.resolve(res);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adammw 💇 To make "the stickler" less sticky

@svizzari svizzari merged commit 075a866 into master Jul 11, 2016
@svizzari svizzari deleted the stef/return_on_investment branch July 11, 2016 05:29
@svizzari svizzari changed the title [BUG] Fixes an issue where Save Hook rules aren't being respect for synchronous return [AF-387][BUG] Fixes an issue where Save Hook rules aren't being respect for synchronous return Jul 11, 2016
@zendesk-deploy
Copy link

This PR was deployed to Production Release. Reference: v2.0.1

@zendesk-deploy
Copy link

This PR was deployed to Update Major Version. Reference: v2.0.1

@zendesk-deploy
Copy link

This PR was deployed to Production Release. Reference: v2.0.9

@zendesk-deploy
Copy link

This PR was deployed to Pod19-Pod24 (Release). Reference: v2.0.16

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.

5 participants