Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Remove Async handling from the core methods #746

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Feb 2, 2023

This is a continuation of the efforts set in #683. Handling the Async APIs in the mapping layer. Please take a look at issue #742 for more details. This can also help the work in grafana/k6#4403—where we need to remove the promises and return errors 🤔?

Closes #742

@inancgumus inancgumus self-assigned this Feb 2, 2023
@inancgumus inancgumus requested review from ankur22 and ka3de February 2, 2023 09:04
@inancgumus inancgumus marked this pull request as ready for review February 2, 2023 09:04
Copy link
Collaborator

@ka3de ka3de left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

This is a continuation of the efforts set in #683.
Handling the Async API handling in the mapping
layer.
@inancgumus inancgumus force-pushed the refactor/742-remove-async-handling-common branch from 77e12d4 to a2bb6a2 Compare February 2, 2023 09:37
@inancgumus
Copy link
Member Author

inancgumus commented Feb 2, 2023

Hey, @grafana/k6-browser, I forgot to return values from some functions and force-pushed now. Take another look if you want. No behavior change (since the methods are not implemented)—returned values are reminders for us when we want to implement these methods in the future.

@ankur22
Copy link
Collaborator

ankur22 commented Feb 2, 2023

Guys, @grafana/k6-browser, I forgot to return values from some functions and force-pushed now. Take another look if you want. No behavior change (since the methods are not implemented)—returned values are reminders for us when we want to implement these methods in the future.

No problem. Looks even better now 😄 Could you have done a fixup instead of a force push?

@ka3de
Copy link
Collaborator

ka3de commented Feb 2, 2023

Guys, @grafana/k6-browser, I forgot to return values from some functions and force-pushed now. Take another look if you want. No behavior change (since the methods are not implemented)—returned values are reminders for us when we want to implement these methods in the future.

I guess adding the return types for these methods do not harm, but I wonder if it's necessary or the best to do that in this PR considering that we are now not implementing them and they will panic in any case?

Also, I personally lack a little bit of context to know if all the defined types are correct, although they look correct! But for example, in this method the returned type does not seem to match with the behavior specified in the Godoc, no?

// Finished waits for response to finish, return error if request failed.
func (r *Response) Finished() bool {
// TODO: should return nil|Error
k6ext.Panic(r.ctx, "Response.finished() has not been implemented yet")
return false
}

@inancgumus
Copy link
Member Author

Could you have done a fixup instead of a force push?

@ankur22, yeah, TBH, I didn't want to deal with the flaky tests and put the work on you guys instead. Sorry about that :-(

@inancgumus
Copy link
Member Author

inancgumus commented Feb 2, 2023

@ka3de,

I guess adding the return types for these methods do not harm, but I wonder if it's necessary or the best to do that in this PR considering that we are now not implementing them and they will panic in any case?
Also, I personally lack a little bit of context to know if all the defined types are correct, although they look correct!

The PR is about returning the old behavior and this was the old behavior 🤷

But for example, in this method the returned type does not seem to match with the behavior specified in the Godoc, no?

I understand your concerns and I have the same concerns. That method was in discussions between us long before. We still don't know whether to return an error or bool. I left it as it was (bool). I could have changed the commit message, we can fix it when the time comes to implement it.

@inancgumus inancgumus changed the title Remove promise returning methods in common pkg Remove Async handling from the core methods Feb 2, 2023
@inancgumus inancgumus merged commit 748ae91 into main Feb 2, 2023
@inancgumus inancgumus deleted the refactor/742-remove-async-handling-common branch February 2, 2023 10:12
@inancgumus inancgumus added the productivity Issues and PRs that improve our productivity label Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
productivity Issues and PRs that improve our productivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Async handling from the core methods
3 participants