Skip to content

fix(check): fix check via API not passing results to the callback #563

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

Merged
merged 1 commit into from
Apr 30, 2018

Conversation

RandomSeeded
Copy link

Signed-off-by: RandomSeeded [email protected]

if (typeof callback !== 'function') {
originalErr = originalErr || callback;
originalErr = callback;
Copy link
Author

Choose a reason for hiding this comment

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

this change causing test failures.

As I understand it, the difference between the two only happens when:

  • callback is provided but is not a function
  • originalErr is also provided

When would that ever occur? Attempting to debug via the tests but not easy going due to the child processes

Copy link
Member

Choose a reason for hiding this comment

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

Remove this change please, this is interferring with core functionalities.

if (typeof callback !== 'function') {
originalErr = originalErr || callback;
results = results || originalErr;
Copy link
Author

Choose a reason for hiding this comment

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

@wzrdtales I removed the change from line 6 as you requested.

That said, I don't understand under what circumstances callback is provided yet is not a function.

I'm concerned about leaving line 6 in its original state because if callback is not provided and results are, then originalErr will contain the results and not an error.

Copy link
Author

Choose a reason for hiding this comment

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

LMK if that doesn't make sense to you, not sure if I worded that as clearly as I could have...

Copy link
Member

Choose a reason for hiding this comment

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

If there is an error, there will be no results though :)

Copy link
Member

Choose a reason for hiding this comment

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

And yeah ok, the callback thing, that would need to fit with the condition if the callback is there or not, which is the only unique circumstance here.

Copy link
Member

Choose a reason for hiding this comment

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

But if no callback is passed, that should be valid anyway, since you do not need the results even if they're existent, since you do not deliver them.

Copy link
Author

Choose a reason for hiding this comment

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

Hah! That is true. Still seems a bit fragile to me but I'm OK with it if you are :)

@RandomSeeded
Copy link
Author

Anything else you want here @wzrdtales or is this good to merge?

@wzrdtales
Copy link
Member

hadn't yet time again, last week was quite bloated. will give this a look the next days. please hit me up again should you not receive an answer by friday :)

@RandomSeeded
Copy link
Author

@wzrdtales pinging as requested :)

@wzrdtales
Copy link
Member

Thanks for pinging me :)

Looks good so far merging

@wzrdtales wzrdtales merged commit fb75330 into db-migrate:master Apr 30, 2018
@wzrdtales
Copy link
Member

Sry haven't pushed out a release yet @RandomSeeded . Last days and weeks have been really time consuming for me.

@RandomSeeded
Copy link
Author

No worries @wzrdtales! I just appreciate the work you've done here ❤️

I am still working on a new branch which will have any remaining changes I'm hoping to get merged in (mostly to the mongodb driver) but there's no urgency; I'll just use a small fork in the meantime.

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.

2 participants