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

Added another function to Table that will process async callback func… #571

Conversation

autumn-calhoun
Copy link
Contributor

…tions to resolve issue #570. Also had to bump the ecmaVersion to 8 in eslint to support async await

…tions to resolve issue getgauge#570.  Also had to bump the ecmaVersion to 8 in eslint to support async await

Signed-off-by: Autumn Calhoun <autumn.calhoun@crowncastle.com>
src/table.js Outdated
@@ -8,6 +8,14 @@ var Table = function (protoTable) {
callback(entry);
}
};

this.asyncEntries = async function (callback) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of making a new function, can we just check if the callback is an async function and handle it accordingly?

For example

const AsyncFunction = (async () => {}).constructor;

if(callback instanceof AsyncFunction) {
}

Copy link
Contributor Author

@autumn-calhoun autumn-calhoun Apr 20, 2023

Choose a reason for hiding this comment

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

@zabil Thank you for the suggestion, I am new to javascript, so that is helpful. I have made the suggested changes.

Signed-off-by: Autumn Calhoun <autumn.calhoun@crowncastle.com>
@zabil zabil merged commit 364a73e into getgauge:master Apr 29, 2023
@zabil
Copy link
Member

zabil commented Apr 29, 2023

Thanks for the change @autumn-calhoun!

@autumn-calhoun autumn-calhoun deleted the 570_support_async_actions_in_table_callback branch May 1, 2023 12:01
@autumn-calhoun
Copy link
Contributor Author

@zabil I see the build for the merge to master failed. I don't see a way to rerun it, and it looks like the failed test has nothing to do with my changes. What do I need to do to resolve this?

@zabil
Copy link
Member

zabil commented May 4, 2023

The build is unfortunately failing for some other reason. It's been flaky in the past. I am gonna spend some time looking at it. Will do it next week.

@autumn-calhoun
Copy link
Contributor Author

@zabil Are there any updates on the build?

@autumn-calhoun
Copy link
Contributor Author

@zabil Sorry to keep bothering you, but we would like to be able to utilize this fix. Do you have any update on the build?

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 8, 2023

Hi @autumn-calhoun - managed to fix the build and release as 3.0.0 (along with some dependency security fixes)

@autumn-calhoun
Copy link
Contributor Author

autumn-calhoun commented Jul 10, 2023 via email

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 10, 2023

Is there a test that fails in your environment on 3.0.0? What is the OS and node version you are running?

Did the version as of your PR here work in your env earlier or you are not sure? (Want to figure out if any of the dependency bumps I made regressed something for you - don't think so, but want to check)

It's probably best that we understand what is going on to avoid it being broken again.

@autumn-calhoun
Copy link
Contributor Author

autumn-calhoun commented Jul 10, 2023 via email

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 10, 2023

OK, your change in #576 doesn't seem to make anything worse anyway.

Do you perhaps have babel or similar in your "real" environment, maybe transforming asyncs to generator functions or something like that which breaks the earlier test?

@autumn-calhoun
Copy link
Contributor Author

autumn-calhoun commented Jul 10, 2023 via email

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

Successfully merging this pull request may close these issues.

3 participants