Skip to content

Conversation

@andresmgot
Copy link
Contributor

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
Contributor

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
Contributor

@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
Contributor 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