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

Update Completable interface with custom options #47

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

andresmgot
Copy link
Collaborator

Fixes #46

Note that this is a breaking change since the Completable interface has different parameters but the only datasources that use them are the ones I maintain (so I will change them after this PR). Do you think we should bump the major version anyway?

completion.go Outdated
Comment on lines 50 to 54
err := json.NewDecoder(req.Body).Decode(&options)
if err != nil {
handleError(rw, err)
return
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
err := json.NewDecoder(req.Body).Decode(&options)
if err != nil {
handleError(rw, err)
return
}
if err := json.NewDecoder(req.Body).Decode(&options); err != nil {
handleError(rw, err)
return
}

Copy link
Collaborator

@kminehart kminehart Oct 14, 2021

Choose a reason for hiding this comment

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

x3

I see lots of very similar blocks for decoding Options from req.Body, do you think we should put it into its own function?

I wager there also be a refactor opportunity with handleError where we could call another function that actually returns an error and just handleError once.

@andresmgot andresmgot merged commit 863eb97 into main Oct 15, 2021
@andresmgot andresmgot deleted the completableOptions branch October 15, 2021 07:43
@andresmgot
Copy link
Collaborator Author

Note that this is a breaking change since the Completable interface has different parameters but the only datasources that use them are the ones I maintain (so I will change them after this PR). Do you think we should bump the major version anyway?

I'm going to go ahead and release v2.3 (rather than a major) so people don't need to change the import path and everything.

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.

Extend the Completable interface methods
2 participants