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

[BC] Refactor modTransportProvider to PSR-7 requests, remove modRestClient #15781

Merged
merged 2 commits into from Aug 23, 2021

Conversation

Mark-H
Copy link
Collaborator

@Mark-H Mark-H commented Jul 30, 2021

What does it do?

Refactors the internals of modTransportProvider to use the PSR-7 requests implemented in #15779.

Tested against MODX.com, modmore.com, and modstore.pro package providers.

While standard packages and provider interaction works as expected without server-side changes, this is a Breaking Change specifically for paid extras that currently use $provider->request to validate licenses/retrieve decryption keys as that now returns a different (incompatible) response object. There's really no way around updating those extras with a new version of the encrypted vehicle and license check logic.

Other uses that directly send requests on the provider would also be affected, but are not currently known to me.

Why is it needed?

modRestClient was deprecated in 2.3, but its removal was held off by modTransportProvider using it heavily. Now that we have a better system for HTTP requests, it needed an update.

How to test

Use the package manager like a normal user would: browse, search, download, update etc.

Related issue(s)/PR(s)

Fixes #15469

…lient

Tested against MODX.com, modmore.com, and modstore.pro package providers.

While standard packages and provider interaction works as expected, this is a **Breaking Change** specifically for paid extras that currently use $provider->request to validate licenses/retrieve decryption keys as that now returns a different (incompatible) response object. There's really no way around updating those extras with a new version of the encrypted vehicle.

Other uses that directly send requests on the provider would also be affected, but are not currently known to me.
@Mark-H Mark-H requested a review from opengeek as a code owner July 30, 2021 23:07
@cla-bot cla-bot bot added the cla-signed CLA confirmed for contributors to this PR. label Jul 30, 2021
@Mark-H Mark-H added this to the v3.0.0-beta1 milestone Jul 30, 2021
@Mark-H
Copy link
Collaborator Author

Mark-H commented Jul 31, 2021

Sorry; spotted some issues I thought I'd already fixed last night. Amazing what some sleep can do to find bugs in your own code 😬

@opengeek
Copy link
Member

@Mark-H — My only concern on this is the methods returning error strings. Would it be better for these methods to throw exceptions rather than returning string error messages?

@Mark-H
Copy link
Collaborator Author

Mark-H commented Aug 18, 2021

That would certainly be a cleaner implementation, at the expense of additional breaking changes because this string return for an error is how it works currently. I'd be okay with that.

@opengeek
Copy link
Member

That would certainly be a cleaner implementation, at the expense of additional breaking changes because this string return for an error is how it works currently. I'd be okay with that.

Oh. I was under the impression you were adding these string error messages as a breaking change already. Perhaps I misunderstood some of the method signature changes and what looked like additions of string error messages being returned. I'll review this again in more detail.

@Mark-H
Copy link
Collaborator Author

Mark-H commented Aug 18, 2021

I mean, you're not wrong... I think that was already the behavior of a few of the methods, and what the callers (i.e. the workspace/rest processors) were checking for, so I tried to make it consistent which means a string is now a new return type for some of the methods that didn't have the error handling before.

In hindsight exceptions make a lot more sense so I'm happy to go back in and replace that. Just don't know when, could be a in week or two... or after dinner tonight. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed CLA confirmed for contributors to this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants